diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 00:07:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 00:07:27 +0000 |
commit | b7e6df1abde1112ae1fa0778f45d6053eec3f052 (patch) | |
tree | a879d991b78433cbf419e4968c410982802dece3 /app/policies | |
parent | e924e9e7cb9df21b3bc3d51d5f955da28ba3a225 (diff) | |
download | gitlab-ce-b7e6df1abde1112ae1fa0778f45d6053eec3f052.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/deploy_keys_project_policy.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/policies/deploy_keys_project_policy.rb b/app/policies/deploy_keys_project_policy.rb new file mode 100644 index 00000000000..368377048a4 --- /dev/null +++ b/app/policies/deploy_keys_project_policy.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class DeployKeysProjectPolicy < BasePolicy + delegate { @subject.project } + + with_options scope: :subject, score: 0 + condition(:public_deploy_key) { @subject.deploy_key.public? } + + rule { public_deploy_key & can?(:admin_project) }.enable :update_deploy_keys_project +end |