Forum: Ruby on Rails Role based auth recipe from a subfolder?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ana B. (Guest)
on 2006-04-30 09:00
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

class ArticlesController < AdminController

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 :(
This topic is locked and can not be replied to.