diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-27 12:16:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-27 12:16:21 +0300 |
commit | ff3955ef8efc9582d14c0f684dc8e856475231bd (patch) | |
tree | 95e751639d1f84093cf06e02c44ce473cfe8f4dd /app/policies/achievements | |
parent | bf360857d96de6ae8989af058a88ace9b94e90cc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies/achievements')
-rw-r--r-- | app/policies/achievements/user_achievement_policy.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/policies/achievements/user_achievement_policy.rb b/app/policies/achievements/user_achievement_policy.rb index b500d0a25c8..05650a05490 100644 --- a/app/policies/achievements/user_achievement_policy.rb +++ b/app/policies/achievements/user_achievement_policy.rb @@ -3,5 +3,10 @@ module Achievements class UserAchievementPolicy < ::BasePolicy delegate { @subject.achievement.namespace } + delegate { @subject.user } + + rule { can?(:read_user_profile) | can?(:admin_achievement) }.enable :read_user_achievement + + rule { ~can?(:read_achievement) }.prevent :read_user_achievement end end |