diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/services/groups/group_links/destroy_service.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
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) |