Welcome to mirror list, hosted at ThFree Co, Russian Federation.

personal_access_token_policy.rb « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 31c973f575bcd6fbef670ea45965129da65b5453 (plain)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

class PersonalAccessTokenPolicy < BasePolicy
  condition(:is_owner) { user && subject.user_id == user.id && !subject.impersonation }

  rule { (is_owner | admin) & ~blocked }.policy do
    enable :read_token
    enable :revoke_token
  end
end