Forum: Ruby on Rails Authorization with single table inheritance?

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.
Invincible C. (Guest)
on 2007-04-17 00:43
(Received via mailing list)

I am trying to use Authorization plugin for providing access control for
application.Application has 2 types of users, admins and end-users both
being maintained in a single table with calles users and with the helps
users and admins using STI.
When I make my admin model "user-like" by including statement
"acts_as_authorized_user" and have something like " permit 'admin' " in
of the controller, it gives following error in development log,

"There is not table by name ROLES_ADMINS"

Looks like authorization plugin just reads the class name and tries to
a table with roles_#{class_name}.

On a second attempt I tried including acts_as_authorized_user in User
which is extended by Admin and EndUser Models...despite of having permit
'admin' statement, Rails allows all the controller actions visible to
the users irrespective of their role :(

Has anyone tried this before?

Invincible C. (Guest)
on 2007-04-17 01:36
(Received via mailing list)
ok guys...thats was really a silly mistake...

In my User model I had following statemnt

def has_role?(role,options)

This topic is locked and can not be replied to.