Hi there,
I'm working on a Rails App, in which I use the gems Authlogic and
Declarative Authorization to put Users into different roles.

But because the roles are very different from each other, I thought it
would be better, if every usertype gets its own databasetable / model.

The model [b]Student[/b] has for example the attributes: Name, Birthday,
E-Mail, Grades, Schools, Lessions, Awards and many many more.
But the model [b]Teacher[/b] has only Name, Birthday, E-Mail
The [b]Admin[/b] model gets just Name and E-Mail.

[b]Now my Problem:[/b]
Declarative Authorization and many other authorization-systems, that I
looked in, only working with one Usermodel, in which different roles get
applied.
This would mean, that even Teachers and Admins would have the Attributes
of the Students (but with no Values, which makes validations difficult).
I would like to know, how I can separate Students, Teachers and Admins
into different user models and get it to work with Authlogic and
Declarative Authorization.

I would like to use commands like Teacher.find_by_name('Bob') or
current_user.is_student?

Do you know the answer and can you show me some code examples?
-- 
Posted via http://www.ruby-forum.com/.

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to