Using Django permissions and groups
RBAC is a method of restricting access based on roles assigned to individual users. Django permissions and groups are some of the most thought-through and verbose RBAC systems I have come across in my career. One reason why I always choose Django for any tight-deadline project is primarily due to the authentication and authorization system it provides out of the box. In this section, we will get a high-level overview of how we can use Django groups and permissions in our project.
Using permissions and groups in Django Admin
In Chapter 4, while exploring Django Admin, we used a Django superuser to navigate through the admin panel; hence, there was no permission needed. But as our project moves to production, we want to give restricted access to each user depending upon their use case. For example, a support agent would need view-only access to all payment models and should not have access to any other database. These kinds of RBACs can easily...