2018-07-18 16:03:33 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
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
|
2019-09-17 12:06:48 +00:00
|
|
|
|
|
|
|
ProtectedBranches::DestroyService.prepend_if_ee('EE::ProtectedBranches::DestroyService')
|