I am developing a site where doctors can manage their patients, appointments, etc.
A doctor can have multiple assistants which help them with these activities, and an assistant can belong to multiple doctors.
Both doctors and assistants should be able to sign in from the same login form but for obvious reasons they have different permissions and associations depending on their role, for example patients are associated to the doctors, not to the assistant.
How you suggest would be the best way to approach this? I am contemplating CanCan for the authorization part, and maybe STI for a User model which Doctor and Assistant can inherit from for the authentication part, but can STI handle the HABTM between these 2, plus the other associations each model might have?
Thanks a lot in advance
This should do the trick.
Just make sure you use ‘type’ to set which the user is. You can then use things like:
To determine access to areas.
Shout if you need more info.