Skip to content

Commit

Permalink
Disclosed contact info for whitelisted users
Browse files Browse the repository at this point in the history
  • Loading branch information
tsoganov committed Mar 26, 2024
1 parent 9d69755 commit eda63cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/presenters/contact_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def last_update
private

def disclose_attr_for_org_registrant(attr)
if contact_publishable? || captcha_solved?
if whitelisted_user? || contact_publishable? || captcha_solved?
contact.send(attr.to_sym)
else
disclosable_mask
Expand Down
14 changes: 4 additions & 10 deletions app/presenters/registrant_presenter.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
class RegistrantPresenter < ContactPresenter
def name
if registrant_is_org?
contact.name
else
disclose_data_priv_registrant('name')
end
registrant_is_org? ? contact.name : disclose_data_priv_registrant('name')
end

def email
Expand All @@ -18,11 +14,7 @@ def phone
end

def last_update
if captcha_solved?
contact.last_update
else
disclosable_mask
end
captcha_solved? ? contact.last_update : disclosable_mask
end

private
Expand All @@ -40,7 +32,9 @@ def disclose_attr(attr)
end

def disclose_data_priv_registrant(attr)
return contact.send(attr.to_sym) if whitelisted_user?
return undisclosable_mask unless contact.attribute_disclosed?(attr)

disclose_attr(attr)
end
end

0 comments on commit eda63cf

Please sign in to comment.