gitlab-org--gitlab-foss/app/policies/personal_access_token_policy.rb

9 lines
210 B
Ruby

# frozen_string_literal: true
class PersonalAccessTokenPolicy < BasePolicy
condition(:is_owner) { user && subject.user_id == user.id }
rule { is_owner | admin }.policy do
enable :read_token
end
end