Role based auth recipe from a subfolder?


#1

Hi guys,

I have implemented the recipe for role based auth in the book, it works
perfect(after sometime of pain to make it work fine), im using class
inheritance to authenticate all the classes from one point(class
AdminController in this case) i have this base structure:

class AdminController < ApplicationController

end

class ArticlesController < AdminController

end

i define the following rights(by now i have only defined one role for
easy implementation purpuoses) for the user:

:controller :action
articles list
articles show
articles edit

ok, all of the above works perfect for any controller created and
inherited from the admin controller and also for any roles and rights i
assign to them, here comes my question, cause ill be creating some more
controllers and i want to keep my app organized so, how i can make that
work having the admin controllers inside a subfolder in the controller
folder( ie: app/controllers/admin )?

When i set that structure all the rights arent working anymore and the
user gets permission denied on any controller, even if i change the
rights table controller and action fields with combinations like:

admin/controller admin/action
controller admin/action
admin/controller action

im trying to he user role get the rights path so hope someone can gime
an advice on this :frowning: