Fix permission check #2623

This commit is contained in:
Martin Lensment 2015-08-10 13:07:09 +03:00
parent 9067d0048c
commit 6a758a9d91
2 changed files with 3 additions and 4 deletions

View file

@ -574,7 +574,7 @@ class Domain < ActiveRecord::Base
end end
def pending_update? def pending_update?
statuses.include?(DomainStatus::PENDING_UPDATE) && !statuses.include?(DomainStatus::FORCE_UPDATE) statuses.include?(DomainStatus::PENDING_UPDATE) && !statuses.include?(DomainStatus::FORCE_DELETE)
end end
# public api # public api

View file

@ -4,8 +4,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? || delete_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
@ -461,7 +460,7 @@ class Epp::Domain < Domain
def epp_destroy(frame, user_id, verify = true) def epp_destroy(frame, user_id, verify = true)
return false unless valid? return false unless valid?
if verify && if verify &&
Setting.request_confirmation_on_domain_deletion_enabled && Setting.request_confirmation_on_domain_deletion_enabled &&
frame.css('delete').attr('verified').to_s.downcase != 'yes' frame.css('delete').attr('verified').to_s.downcase != 'yes'