How can i build Role based permissions access in multi client application in django?

1.1k Views Asked by At

I am currently making an architecture for my multi-client application, in which How to implement role based access model.

Every client will make customize-roles and will give permissions to that role.

Finally that role will be assigned to the agent who will then use the application according to the permissions given to his role.

Now my concern is, what can be best practice to make this possible and any idea about architecture that can be implement in Django.

Previously I have made an application which has role based access to the user of application.

In that, I use to save the permissions in the database and at the time of login the permissions of user will save in the session, which later can be use to check the permissions of that user.

2

There are 2 best solutions below

0
On

django has user groups already implemented. All you need to do is create needed groups, assign permissions to them, and then pick needed groups for each user.

relevant docs, tutorial

0
On

Maybe the following application could help you:

"Application for securing access to views with roles (Django contrib Groups). django_roles_access is a Django app for securing access to views. It's built on top of Django contrib Groups interpreted as role."

Django-roles-acces Site