Skip to content
Snippets Groups Projects
Commit 2bdcef4d authored by http://jneen.net/'s avatar http://jneen.net/
Browse files

use a nil subject when we want to check global abilities

parent 2b26270a
No related branches found
No related tags found
1 merge request!5796Refactor ability.rb into Policies
Loading
Loading
@@ -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]
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment