d5bf57a6af
Enable frozen string in: * app/presenters * app/policies Partially addresses #47424.
13 lines
320 B
Ruby
13 lines
320 B
Ruby
# 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
|