2016-07-07 03:36:28 -04:00
|
|
|
module ProtectedBranches
|
2016-07-29 02:13:07 -04:00
|
|
|
class UpdateService < BaseService
|
2016-07-07 03:36:28 -04:00
|
|
|
attr_reader :protected_branch
|
|
|
|
|
2016-07-29 02:13:07 -04:00
|
|
|
def execute(protected_branch)
|
2016-07-29 03:01:15 -04:00
|
|
|
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :admin_project, project)
|
2016-07-27 00:44:38 -04:00
|
|
|
|
2016-07-29 02:13:07 -04:00
|
|
|
@protected_branch = protected_branch
|
|
|
|
@protected_branch.update(params)
|
|
|
|
@protected_branch
|
2016-07-07 03:36:28 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|