我正在尝试在我的Django应用程序中设置权限修饰符。文档提到了它,但我找不到任何关于这个“codename”代表什么的解释(是模型字段?模型方法?权限方法?)。
codename是什么,我在哪里可以设置codenames?
链接:https://docs.djangoproject.com/en/1.9/topics/auth/default/#the-permission-required-decorator
codename是什么,我在哪里可以设置codenames?
链接:https://docs.djangoproject.com/en/1.9/topics/auth/default/#the-permission-required-decorator
can_approve_dish
是在哪里定义或执行的还不太清楚。我猜测有一个权限文件,其中包含一个名为DishPermissions
的类和一个名为can_approve_dish
的方法? - Protoauth_permissions
表中。并且所有绑定到用户的权限都会添加到user_permissions
表中。请查看此链接:https://docs.djangoproject.com/en/1.9/topics/auth/default/#topic-authorization - Rohit Jain