[SOLVED] Use plone.app.workflow 3.0 to extend Sharing Tab with more Roles/ Permissions [Plone4]

Hi,

did anyone use the following (earlier it was collective.sharingroles for Plone3) to extend the Roles Roles/Permissions available in the Sharing Tab ?

I've tried adding the sharing.xml where it is supposed to be but it looks like the new Roles are not shown in the Sharing Tab, both with pre-existing permissions and with new ones also defined in the rolemap.xml

I upgraded from an earlier version to 3.0 pinning it in buildout.cfg / locks.cfg but nothing changes,
i'm quite confused in how i'm supposed to use the feature of the sharing.xml declaration.

Has anyone ever did this or know how to use it ?

Thanks !

I've fixed this by creating a localroles.py file in my module with:

from zope.interface import implements
from plone.app.workflow.interfaces import ISharingPageRole
from plone.app.workflow.permissions import DelegateRoles 

class AcquirerRole(object):
    implements(ISharingPageRole)
    
    title = u"Can XXXXXX"
    required_permission = DelegateRoles

And then registering an Utility in my module's configure.zcml :slight_smile:

   <utility
      name="Acquirer"
      factory=".localroles.AcquirerRole"
      />

At that point, finally the sharing.xml configuration was interpreted and applied:

<?xml version="1.0"?>
<sharing xmlns:i18n="http://xml.zope.org/namespaces/i18n">
  <role
      id="Acquirer"
      title="Can XXXXXX"
      permission="Permission XXXXXX"
      />
</sharing>

Oh by the way.. it works only with plone.app.workflow version 2.0.6.

With version 3.0.0 i got NameError: name 'can_view_groups' is not defined and had to renounce...

Plone Foundation Code of Conduct