debian-mirror-gitlab/app/policies/deploy_token_policy.rb

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

14 lines
320 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
class DeployTokenPolicy < BasePolicy
with_options scope: :subject, score: 0
2018-11-18 11:00:15 +05:30
condition(:maintainer) { @subject.project.team.maintainer?(@user) }
2018-05-09 12:01:36 +05:30
rule { anonymous }.prevent_all
2018-11-18 11:00:15 +05:30
rule { maintainer }.policy do
2018-05-09 12:01:36 +05:30
enable :create_deploy_token
enable :update_deploy_token
end
end