3

I use Declarative Authorization and Authlogic and now wants to create a dashboard for the administration. About ActiveScaffold will be an overview of the different controllers are shown.

However, I have the problem that I can admin no "admin rights" to the subfolders app/controllers/admin/admin_controller. How can I do that?

Currently my Authorization_rules.rb looks like this:

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

But that does not work! Can someone help me? Thanks

subprime
  • 1,217
  • 8
  • 20
  • 34
  • I solve this some minutes later. If you want to add rules for subfolders you must something like this: rule for admin/admin_controller: role :admin do has_permissions_on :admin_admin, :to=>[:index] end – subprime Mar 19 '10 at 13:42
  • 1
    good job. btw it's perfectly correct to post your own solution as an answer and accept it, as far as I know. – alex.zherdev Mar 19 '10 at 14:09

1 Answers1

6

I solve this some minutes later. If you want to add rules for subfolders you must something like this: rule for admin/admin_controller:

role :admin do 
  has_permissions_on :admin_admin, :to=>[:index] 
end 
subprime
  • 1,217
  • 8
  • 20
  • 34