0

So Django's built in registration, login, and database fit everything almost everything I need for my application, however, I need a boolean parameter in the database to determine if a user has permission to do something. Am I able to add this to the database while still being able to use the built-ins?

catpuccino
  • 41
  • 4
  • Django's authentication system has already permissions, permissions are added to groups, and users can be added to these groups. So a user has a permission if it is added to at least one group with that permission. This is a more extendable way than a boolean, see: https://docs.djangoproject.com/en/2.1/topics/auth/default/#topic-authorization – Willem Van Onsem Feb 03 '19 at 22:44
  • Well you can extend User model to add extra fields take a look at my answer here: https://stackoverflow.com/questions/42478191/django-how-to-add-an-extra-field-in-user-model-and-have-it-displayed-in-the-adm/54305092#54305092 and if you found it useful then don't forget to upvote it :) – Ahtisham Feb 03 '19 at 22:49

0 Answers0