2016-07-07 06:48:07 -04:00
|
|
|
module ProtectedBranches
|
2016-07-29 02:13:07 -04:00
|
|
|
class CreateService < BaseService
|
2016-07-07 06:48:07 -04:00
|
|
|
attr_reader :protected_branch
|
2016-07-07 03:36:28 -04:00
|
|
|
|
2016-07-07 06:48:07 -04:00
|
|
|
def execute
|
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-08-16 01:09:13 -04:00
|
|
|
project.protected_branches.create(params)
|
2016-07-07 06:48:07 -04:00
|
|
|
end
|
2016-07-07 03:36:28 -04:00
|
|
|
end
|
|
|
|
end
|