In my Django project, I would like to add a custom permission to the User model imported from django.contrib.auth
.
(Specifically, a permission to al开发者_JAVA技巧low/deny the user to change their password).
I do understand how to add permissions to my own model, however, I would like the ability to extend an existing model.
Is this possible?
These instructions are a bit outdated, but should give you an idea on how to extend the User
model via inheritance, so that you could add any new functionality to the subclass.
精彩评论