Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2018-03-25 03:54:56 +0300
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2018-03-26 12:29:52 +0300
commit973bd4622dec2c326d05a047b93a7b67c9196fb4 (patch)
tree4e87541b35859580eb32869f358b6b52b4201f8f /app/policies
parente7061396666074c799780a9fc4090267c3b87e12 (diff)
ProtectedBranchPolicy used from Controller for destroy/update
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/protected_branch_policy.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/policies/protected_branch_policy.rb b/app/policies/protected_branch_policy.rb
index 8d44cff1b42..29dd897194d 100644
--- a/app/policies/protected_branch_policy.rb
+++ b/app/policies/protected_branch_policy.rb
@@ -6,10 +6,14 @@ class ProtectedBranchPolicy < BasePolicy
end
rule { can?(:admin_project) }.policy do
+ enable :create_protected_branch
enable :update_protected_branch
+ enable :destroy_protected_branch
end
rule { requires_admin_to_unprotect? & ~admin }.policy do
+ prevent :create_protected_branch
prevent :update_protected_branch
+ prevent :destroy_protected_branch
end
end