开发者

Adding custom permissions to imported models

开发者 https://www.devze.com 2023-02-25 13:26 出处:网络
In my Django project, I would like to add a custom permission to the User model imported from django.contrib.auth.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消