This commit is contained in:
Andres Keskküla 2014-08-18 10:58:01 +03:00
parent 91f373379a
commit 17f7a609cc
2 changed files with 8 additions and 3 deletions

View file

@ -87,12 +87,12 @@ module Epp::ContactsHelper
end
def has_rights?
authInfo = @ph.try(:[], :authInfo).try(:[], :pw) || @ph.try(:[], :chg).try(:[], :authInfo).try(:[], :pw) || []
pw = @ph.try(:[], :authInfo).try(:[], :pw) || @ph.try(:[], :chg).try(:[], :authInfo).try(:[], :pw) || []
id = @ph[:id]
return true if (id && authInfo && !find_contact.nil? && find_contact.auth_info == authInfo)
return true if ( !find_contact.nil? && find_contact.auth_info_matches(pw) )
epp_errors << { code: '2201', msg: t('errors.messages.epp_authorization_error'), value: { obj: 'pw', val: authInfo } }
epp_errors << { code: '2201', msg: t('errors.messages.epp_authorization_error'), value: { obj: 'pw', val: pw } }
return false
end