summaryrefslogtreecommitdiff
path: root/lib/api/groups.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/groups.rb')
-rw-r--r--lib/api/groups.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index a8b1cdab021..26fa00d6186 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -137,6 +137,10 @@ module API
end
end
# rubocop: enable CodeReuse/ActiveRecord
+
+ def authorize_group_creation!
+ authorize! :create_group
+ end
end
resource :groups do
@@ -169,7 +173,7 @@ module API
if parent_group
authorize! :create_subgroup, parent_group
else
- authorize! :create_group
+ authorize_group_creation!
end
group = create_group