summaryrefslogtreecommitdiff
path: root/app/services/protected_branches/update_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/protected_branches/update_service.rb')
-rw-r--r--app/services/protected_branches/update_service.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/services/protected_branches/update_service.rb b/app/services/protected_branches/update_service.rb
new file mode 100644
index 00000000000..89d8ba60134
--- /dev/null
+++ b/app/services/protected_branches/update_service.rb
@@ -0,0 +1,13 @@
+module ProtectedBranches
+ class UpdateService < BaseService
+ attr_reader :protected_branch
+
+ def execute(protected_branch)
+ raise Gitlab::Access::AccessDeniedError unless can?(current_user, :admin_project, project)
+
+ @protected_branch = protected_branch
+ @protected_branch.update(params)
+ @protected_branch
+ end
+ end
+end