Django object-based permisson
Fanciful moment
According to the real needs, django model-based permission is not enough. So we need to focus on the object level. How could we do? Here is the solution.
Object-based permission
The django framework will check model-based permissions firstly, then check the object-based permissions. So if we want to add an object-based permission successfully, we should add user a model-based permission or a permission group which includes this model-based permission. Here is the sample code.
1 |
|
References:
[2] https://medium.com/djangotube/django-roles-groups-and-permissions-introduction-a54d1070544
Django object-based permisson
https://r-future.github.io/post/object-level-permission-not-working/