diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-08-09 11:58:00 +0100 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-08-21 15:40:22 +0100 |
commit | 5bc9dedf401a10388b9505ccbc11d4802ff76a43 (patch) | |
tree | 418d9ccd51c40a612ce81b336363ad4efcdbed67 /app/controllers/groups_controller.rb | |
parent | 4a2a6d521a260981482ee8e4931ebf06cb4f5b6a (diff) | |
download | gitlab-ce-5bc9dedf401a10388b9505ccbc11d4802ff76a43.tar.gz |
Improves subgroup creation permissions35845-improve-subgroup-creation-permissions
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r-- | app/controllers/groups_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index f76b3f69e9e..994e736d66e 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -26,6 +26,13 @@ class GroupsController < Groups::ApplicationController def new @group = Group.new + + if params[:parent_id].present? + parent = Group.find_by(id: params[:parent_id]) + if can?(current_user, :create_subgroup, parent) + @group.parent = parent + end + end end def create |