mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 05:56:20 +02:00
get contact info through domain transferred code
This commit is contained in:
parent
07bd3fba63
commit
bc31a8231b
2 changed files with 9 additions and 1 deletions
|
@ -54,7 +54,11 @@ class Ability
|
|||
can(:delete, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.transfer_code == pw }
|
||||
|
||||
# Epp::Contact
|
||||
can(:info, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || pw.blank? ? true : c.auth_info == pw }
|
||||
can(:info, Epp::Contact) do |c, pw|
|
||||
c.registrar_id == @user.registrar_id ||
|
||||
pw.blank? ? true : c.auth_info == pw ||
|
||||
c.transferred_passwords.include?(pw)
|
||||
end
|
||||
can(:view_full_info, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || c.auth_info == pw }
|
||||
can(:check, Epp::Contact)
|
||||
can(:create, Epp::Contact)
|
||||
|
|
|
@ -16,6 +16,10 @@ class Epp::Contact < Contact
|
|||
throw(:abort)
|
||||
end
|
||||
|
||||
def transferred_passwords
|
||||
domains.pluck(:transfer_code)
|
||||
end
|
||||
|
||||
class << self
|
||||
# support legacy search
|
||||
def find_by_epp_code(code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue