debian-mirror-gitlab/app/policies/achievements/user_achievement_policy.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
351 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# frozen_string_literal: true
module Achievements
class UserAchievementPolicy < ::BasePolicy
delegate { @subject.achievement.namespace }
2023-06-20 00:43:36 +05:30
delegate { @subject.user }
rule { can?(:read_user_profile) | can?(:admin_achievement) }.enable :read_user_achievement
rule { ~can?(:read_achievement) }.prevent :read_user_achievement
2023-05-27 22:25:52 +05:30
end
end