summaryrefslogtreecommitdiff
path: root/app/controllers/projects/group_links_controller.rb
diff options
context:
space:
mode:
authorMałgorzata Ksionek <meksionek@gmail.com>2019-02-12 13:29:47 +0100
committerMałgorzata Ksionek <meksionek@gmail.com>2019-02-20 11:08:13 +0100
commit211c4e5985bf40afe7cf2391c76a6cfde153fb49 (patch)
treef675af054959391d825b3ebd8d0af02767bf2557 /app/controllers/projects/group_links_controller.rb
parent459276846372d8309220a5667cb4389dcfc66281 (diff)
downloadgitlab-ce-211c4e5985bf40afe7cf2391c76a6cfde153fb49.tar.gz
Change policy regarding group visibility
Diffstat (limited to 'app/controllers/projects/group_links_controller.rb')
-rw-r--r--app/controllers/projects/group_links_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/projects/group_links_controller.rb b/app/controllers/projects/group_links_controller.rb
index 7c713c19762..bc942ba9288 100644
--- a/app/controllers/projects/group_links_controller.rb
+++ b/app/controllers/projects/group_links_controller.rb
@@ -13,9 +13,10 @@ class Projects::GroupLinksController < Projects::ApplicationController
group = Group.find(params[:link_group_id]) if params[:link_group_id].present?
if group
- return render_404 unless can?(current_user, :read_group, group)
+ result = Projects::GroupLinks::CreateService.new(project, current_user, group_link_create_params).execute(group)
+ return render_404 if result[:http_status] == 404
- Projects::GroupLinks::CreateService.new(project, current_user, group_link_create_params).execute(group)
+ flash[:alert] = result[:message] if result[:http_status] == 409
else
flash[:alert] = 'Please select a group.'
end