Allow registrar to see only its own invoices #2819

This commit is contained in:
Martin Lensment 2015-08-14 13:42:21 +03:00
parent 1db36ad16a
commit a551d1b4e0
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ class Ability
# Registrar/api_user dynamic role
def billing
can :view, :registrar_dashboard
can :manage, Invoice
can(:manage, Invoice) { |i| i.buyer_id == @user.registrar_id }
can :manage, :deposit
can :read, AccountActivity
end

View file

@ -522,7 +522,7 @@ describe 'EPP Contact', epp: true do
authInfo: { pw: { value: 'newpassword' } }
}
})
puts Nokogiri xml
response = epp_plain_request(xml, :xml)
response[:results][0][:msg].should == 'Command completed successfully'
response[:results][0][:result_code].should == '1000'