diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-19 14:00:14 -0400 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-19 14:00:14 -0400 |
commit | 27e0c7723ca1eb85222210a20fd3fee1d77733f7 (patch) | |
tree | 0b25b0122c7918382c22ab277df421585f9e58b1 /app/controllers/projects | |
parent | ee2dc0624093a0fe8665778fd0cc734754e7cdc9 (diff) | |
parent | 0063194ad6029915361d282392b6ab207ffd1520 (diff) | |
download | gitlab-ce-27e0c7723ca1eb85222210a20fd3fee1d77733f7.tar.gz |
Merge remote-tracking branch 'origin/master' into ci-commit-as-pipelineci-commit-as-pipeline
# Conflicts:
# db/schema.rb
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/group_links_controller.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/projects/group_links_controller.rb b/app/controllers/projects/group_links_controller.rb index 4159e53bfa9..606552fa853 100644 --- a/app/controllers/projects/group_links_controller.rb +++ b/app/controllers/projects/group_links_controller.rb @@ -7,10 +7,12 @@ class Projects::GroupLinksController < Projects::ApplicationController end def create - link = project.project_group_links.new - link.group_id = params[:link_group_id] - link.group_access = params[:link_group_access] - link.save + group = Group.find(params[:link_group_id]) + return render_404 unless can?(current_user, :read_group, group) + + project.project_group_links.create( + group: group, group_access: params[:link_group_access] + ) redirect_to namespace_project_group_links_path(project.namespace, project) end |