2016-09-13 17:45:13 +05:30
|
|
|
module ProtectedBranches
|
|
|
|
class CreateService < BaseService
|
|
|
|
attr_reader :protected_branch
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def execute(skip_authorization: false)
|
|
|
|
raise Gitlab::Access::AccessDeniedError unless skip_authorization || can?(current_user, :admin_project, project)
|
2016-09-13 17:45:13 +05:30
|
|
|
|
|
|
|
project.protected_branches.create(params)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|