diff options
Diffstat (limited to 'app/policies/user_policy.rb')
-rw-r--r-- | app/policies/user_policy.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index e1efd84e510..d092a2de882 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -10,6 +10,9 @@ class UserPolicy < BasePolicy desc "The profile is private" condition(:private_profile, scope: :subject, score: 0) { @subject.private_profile? } + desc "The user is blocked" + condition(:blocked_user, scope: :subject, score: 0) { @subject.blocked? } + rule { ~restricted_public_level }.enable :read_user rule { ~anonymous }.enable :read_user @@ -20,5 +23,5 @@ class UserPolicy < BasePolicy end rule { default }.enable :read_user_profile - rule { private_profile & ~(user_is_self | admin) }.prevent :read_user_profile + rule { (private_profile | blocked_user) & ~(user_is_self | admin) }.prevent :read_user_profile end |