diff --git a/Gemfile.lock b/Gemfile.lock index e69fa7f99..fcbd6652c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -620,6 +620,3 @@ DEPENDENCIES uuidtools (~> 2.1.4) validates_email_format_of (~> 1.6.3) whenever (~> 0.9.4) - -BUNDLED WITH - 1.10.6 diff --git a/app/models/domain.rb b/app/models/domain.rb index 80cf7bc32..c6a0e7d1f 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -105,6 +105,13 @@ class Domain < ActiveRecord::Base errors.add(:base, :invalid_auth_information_reserved) end + validate :check_permissions + def check_permissions + return unless update_prohibited? || delete_prohibited? + errors.add(:base, I18n.t(:object_status_prohibits_operation)) + false + end + validates :nameservers, object_count: { min: -> { Setting.ns_min_count }, max: -> { Setting.ns_max_count }