mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +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)
|
||||
end
|
||||
|
||||
# public api
|
||||
def update_prohibited?
|
||||
pending_update_prohibited? && pending_delete_prohibited?
|
||||
end
|
||||
|
||||
# public api
|
||||
def delete_prohibited?
|
||||
statuses.include?(DomainStatus::FORCE_DELETE)
|
||||
end
|
||||
|
||||
# TODO: Review the list and disallow epp calls
|
||||
def pending_update_prohibited?
|
||||
(statuses & [
|
||||
|
|
|
@ -5,6 +5,7 @@ class Epp::Domain < Domain
|
|||
before_validation :manage_permissions
|
||||
def manage_permissions
|
||||
return unless update_prohibited?
|
||||
return unless delete_prohibited?
|
||||
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
|
||||
false
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue