diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 9d8b8d737a9b06faf7a8d1589b9e57369d53fbda..f981ec0dbfe42377e15c20c697cafd605e16c2d5 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -30,7 +30,7 @@ module API # Example Request: # POST /groups post do - authorize! :create_group, current_user + authorize! :create_group required_attributes! [:name, :path] attrs = attributes_for_keys [:name, :path, :description, :visibility_level] diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index fdb70af694d9b1037c3bc862e7d0a063176df403..6a20ba95a79a199e2ea2dd873bc5f8faa565fd2e 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -129,7 +129,7 @@ module API forbidden! unless current_user.is_admin? end - def authorize!(action, subject) + def authorize!(action, subject = nil) forbidden! unless can?(current_user, action, subject) end