2018-07-18 16:03:33 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-07-07 07:36:28 +00:00
|
|
|
module ProtectedBranches
|
2016-07-29 06:13:07 +00:00
|
|
|
class UpdateService < BaseService
|
|
|
|
def execute(protected_branch)
|
2018-03-23 18:24:06 +00:00
|
|
|
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :update_protected_branch, protected_branch)
|
2016-07-27 04:44:38 +00:00
|
|
|
|
2017-04-05 17:59:46 +00:00
|
|
|
protected_branch.update(params)
|
|
|
|
protected_branch
|
2016-07-07 07:36:28 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-09-17 12:06:48 +00:00
|
|
|
|
|
|
|
ProtectedBranches::UpdateService.prepend_if_ee('EE::ProtectedBranches::UpdateService')
|