Authorization with single table inheritance?


#1

Hi,

I am trying to use Authorization plugin for providing access control for
my
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
of
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
any
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
find
a table with roles_#{class_name}.

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

Has anyone tried this before?

-Invincible


#2

ok guys…thats was really a silly mistake…

In my User model I had following statemnt

def has_role?(role,options)
true
end

-Invincible.