Add transfer prohibit to admin #2922

This commit is contained in:
Martin Lensment 2015-09-10 11:45:36 +03:00
parent 7064a4b9bc
commit 1d19bc9863
3 changed files with 33 additions and 14 deletions

View file

@ -122,40 +122,40 @@ class DomainStatus < ActiveRecord::Base
class << self class << self
def admin_statuses def admin_statuses
[ [
SERVER_HOLD, SERVER_HOLD,
# sync with admin_statuses_map # sync with admin_statuses_map
# SERVER_MANUAL_INZONE, # SERVER_MANUAL_INZONE,
# SERVER_RENEW_PROHIBITED, # SERVER_RENEW_PROHIBITED,
# SERVER_TRANSFER_PROHIBITED, # SERVER_TRANSFER_PROHIBITED,
# SERVER_REGISTRANT_CHANGE_PROHIBITED, # SERVER_REGISTRANT_CHANGE_PROHIBITED,
# SERVER_ADMIN_CHANGE_PROHIBITED, # SERVER_ADMIN_CHANGE_PROHIBITED,
# SERVER_TECH_CHANGE_PROHIBITED, # SERVER_TECH_CHANGE_PROHIBITED,
SERVER_DELETE_PROHIBITED, SERVER_DELETE_PROHIBITED,
SERVER_UPDATE_PROHIBITED SERVER_UPDATE_PROHIBITED
] ]
end end
def admin_statuses_map def admin_statuses_map
[ [
['Hold', SERVER_HOLD], ['Hold', SERVER_HOLD],
# sync with admin_statuses # sync with admin_statuses
# ['ManualInzone', SERVER_MANUAL_INZONE], # ['ManualInzone', SERVER_MANUAL_INZONE],
# [''], # [''],
# ['RenewProhibited', SERVER_RENEW_PROHIBITED], # ['RenewProhibited', SERVER_RENEW_PROHIBITED],
# ['TransferProhibited', SERVER_TRANSFER_PROHIBITED], ['TransferProhibited', SERVER_TRANSFER_PROHIBITED],
# ['RegistrantChangeProhibited', SERVER_REGISTRANT_CHANGE_PROHIBITED], # ['RegistrantChangeProhibited', SERVER_REGISTRANT_CHANGE_PROHIBITED],
# ['AdminChangeProhibited', SERVER_ADMIN_CHANGE_PROHIBITED], # ['AdminChangeProhibited', SERVER_ADMIN_CHANGE_PROHIBITED],
# ['TechChangeProhibited', SERVER_TECH_CHANGE_PROHIBITED], # ['TechChangeProhibited', SERVER_TECH_CHANGE_PROHIBITED],
# [''], # [''],
['UpdateProhibited', SERVER_UPDATE_PROHIBITED], ['UpdateProhibited', SERVER_UPDATE_PROHIBITED],
['DeleteProhibited', SERVER_DELETE_PROHIBITED] ['DeleteProhibited', SERVER_DELETE_PROHIBITED]
] ]
end end
def admin_not_deletable_statuses def admin_not_deletable_statuses
[ [
OK, OK,
INACTIVE, INACTIVE,
FORCE_DELETE, FORCE_DELETE,
PENDING_CREATE, PENDING_CREATE,
PENDING_DELETE, PENDING_DELETE,

View file

@ -757,7 +757,9 @@ class Epp::Domain < Domain
DomainStatus::PENDING_DELETE, DomainStatus::PENDING_DELETE,
DomainStatus::PENDING_RENEW, DomainStatus::PENDING_RENEW,
DomainStatus::PENDING_TRANSFER, DomainStatus::PENDING_TRANSFER,
DomainStatus::FORCE_DELETE DomainStatus::FORCE_DELETE,
DomainStatus::SERVER_TRANSFER_PROHIBITED,
DomainStatus::CLIENT_TRANSFER_PROHIBITED
]).empty? ]).empty?
end end

View file

@ -1767,6 +1767,23 @@ describe 'EPP Domain', epp: true do
end end
end end
it 'should not transfer when in prohibited status' do
domain.statuses = [DomainStatus::SERVER_TRANSFER_PROHIBITED]
domain.save
pw = domain.auth_info
xml = domain_transfer_xml({
name: { value: domain.name },
authInfo: { pw: { value: pw } }
})
login_as :registrar2 do
response = epp_plain_request(xml)
response[:msg].should == 'Object status prohibits operation'
response[:result_code].should == '2304'
end
end
### UPDATE ### ### UPDATE ###
it 'should update right away without update pending status' do it 'should update right away without update pending status' do
existing_pw = domain.auth_info existing_pw = domain.auth_info