Merge pull request #1533 from internetee/1481-add_client_hold_to_registrar_ui

1481 add client hold to registrar ui
This commit is contained in:
Timo Võhmar 2020-02-26 17:17:59 +02:00 committed by GitHub
commit 3d9e8d2c26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 51 additions and 0 deletions

View file

@ -50,6 +50,7 @@ class Ability
can(:check, Epp::Domain)
can(:create, Epp::Domain)
can(:renew, Epp::Domain) { |d| d.registrar_id == @user.registrar_id }
can(:remove_hold, Epp::Domain) { |d| d.registrar_id == @user.registrar_id }
can(:update, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.transfer_code == pw }
can(:transfer, Epp::Domain)
can(:delete, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.transfer_code == pw }

View file

@ -0,0 +1,9 @@
module RemoveHold
extend ActiveSupport::Concern
def remove_hold(params)
xml = epp_xml.update(name: { value: params[:domain_name] },
rem: [status: { attrs: { s: 'clientHold' }, value: '' }])
current_user.request(xml)
end
end

View file

@ -1,6 +1,7 @@
module Depp
class Domain
include ActiveModel::Conversion
include RemoveHold
extend ActiveModel::Naming
attr_accessor :name, :current_user, :epp_xml