diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-08-23 12:31:17 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-08-23 12:31:17 +0300 |
commit | fbe82e4cd9f4cda7264bb78eab9c5c55e6311518 (patch) | |
tree | de9444c1762fa43c336f595936878677aef8ce43 /app/controllers/groups_controller.rb | |
parent | 64820f9a6c17a348dc771a87618140a5c3c8874d (diff) | |
parent | 101d52b360a6a43f1633c5dd60b78e37bc8c4339 (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.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 |