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