Clear acquireLocalRoles-setting on newly created document

Dear plone community,

We need the acquireLocalRoles-setting to be cleared on newly created instances of content types defined on the filesystem (dexterity-based).

We try to achieve this by calling a transition to a second state after object creation by the new "rule"-feature ("Regel" in deutsch) which is set on the containing folder. In this transition we call a script which calls a browser view to make the change (this approach is planned, still untested). This approach to a solution looks a bit clumsy.

Are there other preferred ways of clearing that setting, maybe in the schema-definition or some init.py routine of the class definition ?

Or can i register a function against an adapter/interface ?? ZCA-magic begins here :slight_smile:

(use zcml instead of grok)

Not sure if I understand things correctly here, but could an option be to create a custom workflow, and run script and set permissions (or add variables) there, for example in 'transactions'

In other words, the things that are set here:

yoursite.cpm/portal_workflow/plone_workflow/manage_properties

Maybe registering an eventhandler on IObjectCreatedEvent like described here would fit your needs: Event handlers — Plone Documentation v5.2 ... no need for workflow transitions and contentrules.

NOTE on the stackoverflow link above: grok got removed from Plone a while ago...

2 Likes