[Rails] Re: Help with authentication/authorisation design
Thanks for the reply Paulo, my question was about the business
relationships involved, and I think you went a long a way towards
answering it.
With regards to a Customer being associated with multiple Garages, good
news, this is not possible, they would have to have separate accounts.
Your solution is great, but it doesn't address all the problems. How
would I handle a customer having ownership of their car only? Would I
add a car_id to User that would be NULL for all users other than
customers? This makes me uneasy, as the logic about the "roles" each
user can full fill would be spread around. The roles I could apply in
cancan would be restricted by the database data. Does that make sense?
it just seems like cancan, and database would be highly coupled, is it a
valid concern?
And how do I handle the superuser having ownership of all garages? I
guess they would have a garage_id of NULL?
Considering that a "Garage" is essentially just a name, I was thinking
that a preferable design would be to somehow model the relationships
between the different types of user directly, but as I couldn't make
that work, I am probably on the wrong track.
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home