Plone: Add permission to role
In a Plone site there is a permission called "access inactive portal content". By default, this is granted to the roles "Manager" and "Owner".
I want to开发者_如何学Python grant this permission to the role "Editor" as well, and I know I can just use the corresponding checkbox in the "Security" tab in the ZMI, but I'd like to do it programmatically in some sort of setup script. How would I do that?
you have to create a new product and add a genericsetup step called "rolemap.xml" with this:
<?xml version="1.0"?>
<rolemap>
<permissions>
<permission name="Access inactive portal content" acquire="False">
<role name="Editor" />
</permission>
</permissions>
</rolemap>
More info:
- http://plone.org/documentation/kb/genericsetup
- http://plone.org/documentation/manual/developer-manual/generic-setup/reference/roles-and-permissions
Bye, Giacomo
精彩评论