Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/groups/group_links/destroy_service.rb')
-rw-r--r--app/services/groups/group_links/destroy_service.rb6
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)