diff options
Diffstat (limited to 'app/services/protected_branches/destroy_service.rb')
-rw-r--r-- | app/services/protected_branches/destroy_service.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/protected_branches/destroy_service.rb b/app/services/protected_branches/destroy_service.rb index 74fdb900c56..8172c896e76 100644 --- a/app/services/protected_branches/destroy_service.rb +++ b/app/services/protected_branches/destroy_service.rb @@ -1,6 +1,8 @@ module ProtectedBranches class DestroyService < BaseService def execute(protected_branch) + raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_protected_branch, protected_branch) + protected_branch.destroy end end |