probably you may want to take a look at a couple of products the guys from Simples Consultoria just released:

https://github.com/simplesconsultoria/sc.contentrules.group
https://github.com/simplesconsultoria/sc.contentrules.localrole

using this products you can create a content rule like this one:

<?xml version="1.0"?>
<contentrules>
 <rule name="new-client" title="New client"
    description="This rule runs when a new client is added."
    enabled="True" event="zope.lifecycleevent.interfaces.IObjectAddedEvent"
    stop-after="False">
  <conditions>
   <condition type="plone.conditions.PortalType">
    <property name="check_types">
     <element>client</element>
    </property>
   </condition>
  </conditions>
  <actions>
   <action type="sc.contentrules.group.CreateGroup">
    <property name="grouptitle">Group for client ${title}</property>
    <property name="groupid">Group ${title}</property>
    <property name="roles">
     <element>Contributor</element>
    </property>
   </action>
   <action type="sc.contentrules.localrole.ApplyLocalRole">
    <property name="roles">
     <element>Contributor</element>
    </property>
    <property name="principal">Group ${title}</property>
   </action>
  </actions>
 </rule>
 <assignment name="new-client" bubbles="True" enabled="True" location=""/>
</contentrules>

so, they use this for the same you're looking for :-)

best regards

Héctor Velarde

Attachment: smime.p7s
Description: Firma criptográfica S/MIME

_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to