J
J
Jekson2019-06-24 11:28:22
Django
Jekson, 2019-06-24 11:28:22

How to use groups in Django?

I have a general educational question. In projects, to restrict the rights to perform operations, I usually rewrite the standard User model and add roles to it through models.BooleanField. On the basis of which I prescribe logic in views through user.request......
I want to understand what advantages the use of group gives, what they are for, or, in fact, changing the user model, I simply duplicate the built-in functionality, and in this case, can I do without them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-06-24
@Lepilov

I rewrite the standard User model and add roles to it through models.BooleanField

You are reinventing the wheel. Django comes with a powerful and handy permissions system out of the box .
Allows you to grant rights to a group of users at once.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question