diff options
Diffstat (limited to 'app/services/groups/group_links/destroy_service.rb')
-rw-r--r-- | app/services/groups/group_links/destroy_service.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/groups/group_links/destroy_service.rb b/app/services/groups/group_links/destroy_service.rb index 6835b6c4637..b0d496ae78c 100644 --- a/app/services/groups/group_links/destroy_service.rb +++ b/app/services/groups/group_links/destroy_service.rb @@ -3,7 +3,11 @@ module Groups module GroupLinks class DestroyService < BaseService - def execute(one_or_more_links) + def execute(one_or_more_links, skip_authorization: false) + unless skip_authorization || group && can?(current_user, :admin_group_member, group) + return error('Not Found', 404) + end + links = Array(one_or_more_links) if GroupGroupLink.delete(links) |