How to implement multiple user types with different roles and permissions in Django?

I’m new to web development using Django Framework and Python programming language and I am tasked to make a mini project that implements the following:

  1. Permissions Management;
  2. Roles Management;
  3. Users Account Management;

What are the appropriate steps for me to accomplish this?

I have read about user authentication and permissions and custom user models but the examples that were given were less complicated than what I actually needed. I have to set up an application that implements multiple user accounts wherein each user can have multiple roles and each role has different permissions. I know that Django has built-in functions to do this but I want to make my own customization as much as possible.

I would like to know if creating Custom User Model extending AbstractBaseUser is the best option there is to accomplish this. Also, I would like to know how to customize the Django built-in admin page, such as replacing or deleting unnecessary fields.

1 Like

Yes , Custom User Model is the best option for that type of work . you can use exclude where you can describe which fields you want to remove and use fields for including you extra fields

1 Like

@Arif, Thanks for your reply. But could there be a way to manage permissions via views and forms, without going to the Admin panel

django store permissions in their permission table ( which is generated when you run migration ). then you just need check whether the object has this permission or not . you can read details from here