Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:33:27+00:00 2026-05-29T18:33:27+00:00

I am developing a site where doctors can manage their patients, appointments, etc. A

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:33:30+00:00Added an answer on May 29, 2026 at 6:33 pm

    This should do the trick.

    Just make sure you use ‘type’ to set which the user is. You can then use things like:

    current_user.is_doctor?
    

    To determine access to areas.

    module User
    
      def is_doctor?
       true if self.type == Doctor
      end
    
      def is_assistant?
       true if self.type == Assistant
      end
    end
    
    
    module Doctor < User
      has_and_belongs_to_many :assistants, :through => "assistant_assignments"
    end
    
    
    module Assistant < User
      has_and_belongs_to_many :doctors, :through => "assistant_assignments"
    end
    

    Shout if you need more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While developing a site which I can't link to directly, I've found a following
I am developing site using codeigniter.I have a form which contains add button and
I'm developing a site where users can publish their videos (similar to YouTube). Is
I've been developing a site using ASP.NET MVC, and have decided to use the
I am currently developing a site and have a need for a javascript-based carousel/slider
i m developing site in Joomla, meanwhile i stuck in a problem,please help me
I'm developing a site which has a flash background playing a small video loop
Currently developing this site and I can't pin point as to why there is
I'm developing site which provides allow to display external sites into iframe with extra
I'm developing a public web site in vs2010, can I keep the authentication as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.