mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Let only owning registrar approve transfer, tests refactor
This commit is contained in:
parent
142db654c4
commit
b6ce705748
4 changed files with 61 additions and 32 deletions
|
@ -211,8 +211,14 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
def transfer(params)
|
||||
return false unless authenticate(params[:pw])
|
||||
pt = pending_transfer
|
||||
|
||||
if pt && params[:action] == 'approve'
|
||||
if params[:current_user].registrar != pt.transfer_from
|
||||
add_epp_error('2304', nil, nil, I18n.t('transfer_can_be_approved_only_by_current_registrar'))
|
||||
return false
|
||||
end
|
||||
|
||||
if pending_transfer && params[:action] == 'approve'
|
||||
approve_pending_transfer and return true
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue