summaryrefslogtreecommitdiff
path: root/app/policies/protected_branch_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/protected_branch_policy.rb')
-rw-r--r--app/policies/protected_branch_policy.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/policies/protected_branch_policy.rb b/app/policies/protected_branch_policy.rb
new file mode 100644
index 00000000000..1a7faa4db40
--- /dev/null
+++ b/app/policies/protected_branch_policy.rb
@@ -0,0 +1,9 @@
+class ProtectedBranchPolicy < BasePolicy
+ delegate { @subject.project }
+
+ rule { can?(:admin_project) }.policy do
+ enable :create_protected_branch
+ enable :update_protected_branch
+ enable :destroy_protected_branch
+ end
+end