summaryrefslogtreecommitdiff
path: root/app/controllers/groups_controller.rb
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-08-24 09:06:38 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2017-08-24 09:06:38 +1100
commit0f006dc0699baa4c182363d7988392955e517b1d (patch)
tree3d42539b1c1999f9f97d2e16b9ce602a834e0fa6 /app/controllers/groups_controller.rb
parent5af8ac8e61787c63558eb1cfbd0959454586f416 (diff)
parentcdf87fe890a589da2c73e2f758e98f1c014d7953 (diff)
downloadgitlab-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.rb7
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