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:
authorRuben Davila <rdavila84@gmail.com>2017-09-07 21:35:45 +0300
committerRuben Davila <rdavila84@gmail.com>2017-09-07 21:47:58 +0300
commit62bb6235c229a869052180f9709c4801116f02cc (patch)
treea28626180edfe5f8abef6e5e2e44a2128c636f49 /lib/api/groups.rb
parentbc955cfc8e75e17897ab25717176209fefbba915 (diff)
Make Members with Owner and Master roles always able to create subgroups
Diffstat (limited to 'lib/api/groups.rb')
-rw-r--r--lib/api/groups.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index 31a918eda60..e817dcbbc4b 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -74,7 +74,12 @@ module API
use :optional_params
end
post do
- authorize! :create_group
+ parent_group = find_group!(params[:parent_id]) if params[:parent_id].present?
+ if parent_group
+ authorize! :create_subgroup, parent_group
+ else
+ authorize! :create_group
+ end
group = ::Groups::CreateService.new(current_user, declared_params(include_missing: false)).execute