[Product-Developers] Setting localroles for groups, but having problems with permissions.

Héctor Velarde hector.velarde at gmail.com
Thu Sep 15 12:51:49 UTC 2011


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4926 bytes
Desc: Firma criptogr??fica S/MIME
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20110915/0f38a46e/attachment.p7s>


More information about the Product-Developers mailing list