Django-cms 根据字段数据自定义用户权限
Django-cms custom user permission based on field data
我看到有一些用户权限类型适合我select,但我在想我是否可以拥有自己的自定义权限设置。
我正在尝试构建一个具有来自不同地区的多个用户的 cms 系统。他们每个人都不能删除其他用户输入的数据,每个人都会输入数据,并带有一个字段,表明它是来自谁的数据。
我必须自己编写代码还是 Django-cms 实际上提供了这个选项。
如果能提供参考资料最好。
谢谢
Django CMS(至少在最新版本中)提供了这个选项。来自文档:
Page permissions
The Page permission formset has multiple checkboxes defining different
permissions: can edit, can add, can delete, can change advanced
settings, can publish, can move and can change permission. These
define what kind of actions the user/group can do on the pages on
which the permissions are being granted through the Grant on
drop-down.
Can change permission refers to whether the user can change the
permissions of his subordinate users. Bob is the subordinate of Alice
if one of:
Bob was created by Alice Bob has at least one page permission set on
one of the pages on which Alice has the Can change permissions right
Note: Mind that even though a new user has permissions to change a
page, that doesn’t give him permissions to add a plugin within that
page. In order to be able to add/change/delete plugins on any page,
you will need to go through the usual Auth.User model and give the new
user permissions to each plugin you want him to have access to.
Example: if you want the new user to be able to use the text plugin,
you will need to give him the following rights: text | text | Can add
text, text | text | Can change text, text | text | Can delete text.
Here's the link to the permissions page 的文档,其中更详细地介绍了限制用户使用 add/edit 插件和模板以及其他有趣内容的能力。
我看到有一些用户权限类型适合我select,但我在想我是否可以拥有自己的自定义权限设置。
我正在尝试构建一个具有来自不同地区的多个用户的 cms 系统。他们每个人都不能删除其他用户输入的数据,每个人都会输入数据,并带有一个字段,表明它是来自谁的数据。
我必须自己编写代码还是 Django-cms 实际上提供了这个选项。
如果能提供参考资料最好。 谢谢
Django CMS(至少在最新版本中)提供了这个选项。来自文档:
Page permissions
The Page permission formset has multiple checkboxes defining different permissions: can edit, can add, can delete, can change advanced settings, can publish, can move and can change permission. These define what kind of actions the user/group can do on the pages on which the permissions are being granted through the Grant on drop-down.
Can change permission refers to whether the user can change the permissions of his subordinate users. Bob is the subordinate of Alice if one of:
Bob was created by Alice Bob has at least one page permission set on one of the pages on which Alice has the Can change permissions right Note: Mind that even though a new user has permissions to change a page, that doesn’t give him permissions to add a plugin within that page. In order to be able to add/change/delete plugins on any page, you will need to go through the usual Auth.User model and give the new user permissions to each plugin you want him to have access to. Example: if you want the new user to be able to use the text plugin, you will need to give him the following rights: text | text | Can add text, text | text | Can change text, text | text | Can delete text.
Here's the link to the permissions page 的文档,其中更详细地介绍了限制用户使用 add/edit 插件和模板以及其他有趣内容的能力。