2018-03-24 07:05:04 -04:00
|
|
|
module ProtectedBranches
|
|
|
|
class DestroyService < BaseService
|
|
|
|
def execute(protected_branch)
|
2018-03-24 20:54:56 -04:00
|
|
|
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_protected_branch, protected_branch)
|
|
|
|
|
2018-03-24 07:05:04 -04:00
|
|
|
protected_branch.destroy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|