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