Using admin panel with declarative authorization and autology?

I use Declarative Authorization and Authlogic and now I want to create a control panel for the administration. About ActiveScaffold will provide an overview of the various controllers.

However, I have a problem that I can administer "admin rights" for the subfolders app / controllers / admin / admin_controller. How can i do this?

Currently, my Authorization_rules.rb looks like this:

authorization do
    role :admin do
      includes :guest
      has_permission_on :admin,     :to => [:index]
    end
end

But it does not work! Can anybody help me? Thanks

+3
source share
1 answer

. , - : admin/admin_controller:

role :admin do 
  has_permissions_on :admin_admin, :to=>[:index] 
end 
+6

Source: https://habr.com/ru/post/1737681/


All Articles