mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 20:19:34 +02:00
Added dedicated force delete method #2623
This commit is contained in:
parent
147948548f
commit
b0d4aff32e
2 changed files with 7 additions and 0 deletions
|
@ -577,10 +577,16 @@ class Domain < ActiveRecord::Base
|
||||||
statuses.include?(DomainStatus::PENDING_UPDATE)
|
statuses.include?(DomainStatus::PENDING_UPDATE)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# public api
|
||||||
def update_prohibited?
|
def update_prohibited?
|
||||||
pending_update_prohibited? && pending_delete_prohibited?
|
pending_update_prohibited? && pending_delete_prohibited?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# public api
|
||||||
|
def delete_prohibited?
|
||||||
|
statuses.include?(DomainStatus::FORCE_DELETE)
|
||||||
|
end
|
||||||
|
|
||||||
# TODO: Review the list and disallow epp calls
|
# TODO: Review the list and disallow epp calls
|
||||||
def pending_update_prohibited?
|
def pending_update_prohibited?
|
||||||
(statuses & [
|
(statuses & [
|
||||||
|
|
|
@ -5,6 +5,7 @@ class Epp::Domain < Domain
|
||||||
before_validation :manage_permissions
|
before_validation :manage_permissions
|
||||||
def manage_permissions
|
def manage_permissions
|
||||||
return unless update_prohibited?
|
return unless update_prohibited?
|
||||||
|
return unless delete_prohibited?
|
||||||
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
|
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue