summaryrefslogtreecommitdiff
path: root/app/policies/deploy_token_policy.rb
blob: e648df3edfc8abc373a04a06797b0fdb443b2ba9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

class DeployTokenPolicy < BasePolicy
  with_options scope: :subject, score: 0
  condition(:maintainer) { @subject.project.team.maintainer?(@user) }

  rule { anonymous }.prevent_all

  rule { maintainer }.policy do
    enable :create_deploy_token
    enable :update_deploy_token
  end
end