summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2018-03-25 03:45:43 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2018-03-26 10:29:53 +0100
commit48717b434d583a0be1f22803edd6948c13e11591 (patch)
tree1d03ffc89bd912f79759877ce0ef42018429e636 /app/policies
parentb6a4c0181b2a3d8bebde549cb9ad8dc6da8361d6 (diff)
downloadgitlab-ce-48717b434d583a0be1f22803edd6948c13e11591.tar.gz
Revert exploratory branch restriction policyjej/add-protected-branch-policy
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/protected_branch_policy.rb10
1 files changed, 0 insertions, 10 deletions
diff --git a/app/policies/protected_branch_policy.rb b/app/policies/protected_branch_policy.rb
index 29dd897194d..1a7faa4db40 100644
--- a/app/policies/protected_branch_policy.rb
+++ b/app/policies/protected_branch_policy.rb
@@ -1,19 +1,9 @@
class ProtectedBranchPolicy < BasePolicy
delegate { @subject.project }
- condition(:requires_admin_to_unprotect?, scope: :subject) do
- @subject.name == 'master' && Gitlab::CurrentSettings.only_admins_can_unprotect_master_branch?
- 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