diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-08-24 09:06:38 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-08-24 09:06:38 +1100 |
commit | 0f006dc0699baa4c182363d7988392955e517b1d (patch) | |
tree | 3d42539b1c1999f9f97d2e16b9ce602a834e0fa6 /app/controllers/groups_controller.rb | |
parent | 5af8ac8e61787c63558eb1cfbd0959454586f416 (diff) | |
parent | cdf87fe890a589da2c73e2f758e98f1c014d7953 (diff) | |
download | gitlab-ce-0f006dc0699baa4c182363d7988392955e517b1d.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
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 |