gitlab-org--gitlab-foss/app/policies/deploy_token_policy.rb
Mayra Cabrera 171b2625b1 Addreses backend review suggestions
- Remove extra method for authorize_admin_project
- Ensure project presence
- Rename 'read_repo' to 'read_repository' to be more verbose
2018-04-06 21:20:16 -05:00

11 lines
277 B
Ruby

class DeployTokenPolicy < BasePolicy
with_options scope: :subject, score: 0
condition(:master) { @subject.project.team.master?(@user) }
rule { anonymous }.prevent_all
rule { master }.policy do
enable :create_deploy_token
enable :update_deploy_token
end
end