summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-12-29 18:51:29 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-12-29 18:51:29 +0000
commit23fc1f666cf62b21485b216bbd86a10637a98d6c (patch)
tree7e3fef4337ea45ec79421db93648e11a7d76e288 /app/services
parent714f70a38df10e678bffde6e6081a97e31d8317c (diff)
parent283e868ef523185b0ee314b9e2164599780d888b (diff)
downloadgitlab-ce-23fc1f666cf62b21485b216bbd86a10637a98d6c.tar.gz
Merge branch 'dz-nested-group-misc' into 'master'
Miscellaneous improvements to the nested groups feature See merge request !8308
Diffstat (limited to 'app/services')
-rw-r--r--app/services/groups/create_service.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/services/groups/create_service.rb b/app/services/groups/create_service.rb
index 2bccd584dde..febeb661fb5 100644
--- a/app/services/groups/create_service.rb
+++ b/app/services/groups/create_service.rb
@@ -12,6 +12,13 @@ module Groups
return @group
end
+ if @group.parent && !can?(current_user, :admin_group, @group.parent)
+ @group.parent = nil
+ @group.errors.add(:parent_id, 'manage access required to create subgroup')
+
+ return @group
+ end
+
@group.name ||= @group.path.dup
@group.save
@group.add_owner(current_user)