From eda63cfd2d2e52e4177d1b916f858b73a69c0037 Mon Sep 17 00:00:00 2001 From: tsoganov Date: Tue, 26 Mar 2024 15:03:08 +0200 Subject: [PATCH] Disclosed contact info for whitelisted users --- app/presenters/contact_presenter.rb | 2 +- app/presenters/registrant_presenter.rb | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/presenters/contact_presenter.rb b/app/presenters/contact_presenter.rb index 98153c75..ae41b89b 100644 --- a/app/presenters/contact_presenter.rb +++ b/app/presenters/contact_presenter.rb @@ -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 diff --git a/app/presenters/registrant_presenter.rb b/app/presenters/registrant_presenter.rb index 35ee408a..3b4be4f4 100644 --- a/app/presenters/registrant_presenter.rb +++ b/app/presenters/registrant_presenter.rb @@ -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 @@ -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 @@ -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