Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-08-23 12:31:17 +0300
committerDouwe Maan <douwe@selenight.nl>2017-08-23 12:31:17 +0300
commitfbe82e4cd9f4cda7264bb78eab9c5c55e6311518 (patch)
treede9444c1762fa43c336f595936878677aef8ce43 /app/controllers/groups_controller.rb
parent64820f9a6c17a348dc771a87618140a5c3c8874d (diff)
parent101d52b360a6a43f1633c5dd60b78e37bc8c4339 (diff)
Merge branch 'master' into issue-discussions-refactor
# Conflicts: # package.json
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