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:
Diffstat (limited to 'app/services/protected_branches/update_service.rb')
-rw-r--r--app/services/protected_branches/update_service.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/protected_branches/update_service.rb b/app/services/protected_branches/update_service.rb
index 4a2b1be9c93..58f2f774bae 100644
--- a/app/services/protected_branches/update_service.rb
+++ b/app/services/protected_branches/update_service.rb
@@ -4,12 +4,13 @@ module ProtectedBranches
def initialize(project, current_user, id, params = {})
super(project, current_user, params)
- @id = id
+ @protected_branch = ProtectedBranch.find(id)
end
def execute
+ raise Gitlab::Access::AccessDeniedError unless current_user.can?(:admin_project, project)
+
ProtectedBranch.transaction do
- @protected_branch = ProtectedBranch.find(@id)
set_access_levels!
end