summaryrefslogtreecommitdiff
path: root/app/services/protected_branches/create_service.rb
blob: 6212fd69077b98de59f3ed6a7c990ffd2d440de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
module ProtectedBranches
  class CreateService < BaseService
    attr_reader :protected_branch

    def execute(skip_authorization: false)
      raise Gitlab::Access::AccessDeniedError unless skip_authorization || can?(current_user, :admin_project, project)

      project.protected_branches.create(params)
    end
  end
end