You can try django-role-permissions, its an app that does exactly what you need. It's built on top of django's permissions system and requires no new models. https://github.com/vintasoftware/django-role-permissions
On Sat, Jun 13, 2015 at 10:23 AM, Gergely Polonkai <[email protected]> wrote: > Hello, > > if you create groups, you don’t have to create different models for > different roles (well, unless you have different data to store for Students > and Instructors). Just connect the correct User object with the correct > Group. > > Another method is to use the Permission handling system of Django, > although it is a bit more complex. > > Best, > Gergely > > 2015-06-13 10:22 GMT+02:00 Frankline <[email protected]>: > >> *Hi all,* >> >> *I am creating a project that will require two different user roles: An >> Instructor role and a Student role. Both will use a common login form. An >> Instructor can assign a Student to a Course. Both will have access to >> different parts of the system.* >> >> *I wish to know the best way to model this. Currently I'm thinking of the >> following:* >> >> *1) Use a single User model having a user_type field* >> >> *2) Create Instructor and Student model that both inherit from base User >> model.* >> >> *3) Create an Instructor and a Student group and then assign people to >> the correct group based on some value at the time of registration.* >> >> *Is there a better way to handle this apart from the above? What are the >> best practices to follow in this case? Or perhaps add a UserProfile?* >> >> *Regards,* >> *Frankline* >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CAEAUGdXR2n0XR6gV1fMbvHxMLAJryvo7n6gJJOE615z%3DVWwpJQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAEAUGdXR2n0XR6gV1fMbvHxMLAJryvo7n6gJJOE615z%3DVWwpJQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CACczBUK11KXp542vqVZLTfPEG9qbcKjjAQVonPNjf4uDaO3VbA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CACczBUK11KXp542vqVZLTfPEG9qbcKjjAQVonPNjf4uDaO3VbA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Filipe Ximenes*+55 (81) 8245-9204 *Vinta Software Studio*http://www.vinta.com.br -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA-QWB1tCg_754GTzVXj0Zf2AP_eWaif9guN%2BonUu3SU46Ad%3DA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

