Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

declarative_authorization and namespaces

Do you know - can declarative_authorization control access to namespace'd resources or not? I've tried something like

has_permission_on [:admin, :users], :to => [:index, :show, :new, :create, :edit, :update, :destroy, :search]

but it's not working :( any ideas on this?

like image 239
Alexey Poimtsev Avatar asked Jun 20 '10 11:06

Alexey Poimtsev


1 Answers

This will work:

has_permission_on :admin_users, :to => [:index, :show, :new, :create, :edit, :update, :destroy, :search]

declarative_authorization prefixes the resource name with the namespace as [:admin, :users] could also mean that the user has permission on the admin_controller and the users_controller.

like image 78
Tomas Markauskas Avatar answered Sep 22 '22 13:09

Tomas Markauskas