summaryrefslogtreecommitdiff
path: root/app/services/protected_branches/update_service.rb
blob: da4c96b3e5f0145dca039ce6081ac1243ecbf541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module ProtectedBranches
  class UpdateService < BaseService
    attr_reader :protected_branch

    def execute(protected_branch)
      raise Gitlab::Access::AccessDeniedError unless current_user.can?(:admin_project, project)

      @protected_branch = protected_branch
      @protected_branch.update(params)
      @protected_branch
    end
  end
end