Johannes Charra
Johannes Charra

Reputation: 29953

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 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?

Upvotes: 6

Views: 987

Answers (1)

Giacomo Spettoli
Giacomo Spettoli

Reputation: 4496

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:

Bye, Giacomo

Upvotes: 11

Related Questions