Yamini
Returning Observer

Possibility to apply same "permissions" on all store elements via script

Dear community

In site architect, Is it possible to inherit the permissions from site store folder(blue structure) to page content folder (green structure ) directly via a script, if someone changes the permission at site store level?

Kindly suggest.
435337_pastedImage_0.png

0 Kudos
2 Replies
felix_reinhold
Occasional Collector

Re: Possibility to apply same "permissions" on all store elements via script

Hi Yamini,

haven't tried that, but I'd guess you could do sth. like this:

yourPageRefFolder.getDefinedPrincipalPermissions().forEach(principal -> {

     yourPageFolder.setPermission(principal, yourPageRefFolder.getPermission(principal));

});

As a trigger you could use a PermissionListener - in that case you wouldn't even need to set all permission, since it provides the changed permission.

Best regards

Felix

0 Kudos
hoebbel
e-Spirit employee

Re: Possibility to apply same "permissions" on all store elements via script

Dear Yamini,

but be aware, that a pagestorefolder isn't referred from a pagereffolder and a page can be referred from more than one pageref.

So even if you take the startnode (or any pageref) from a pagereffolder and then the parent element of the referred page, the change of the permissions may provide unexpected results.

The structure of the sitestore and pagestore can be completely different, especially on old projects!

Best regards

Holger

0 Kudos