Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascrp/0a6353ae143e71466358c93b7e77c225 to your computer and use it in GitHub Desktop.
Save douglascrp/0a6353ae143e71466358c93b7e77c225 to your computer and use it in GitHub Desktop.
Set alfresco node site role based permission using javascript
// Print object's permissions
logger.warn(document.directPermissions);
logger.warn(document.fullPermissions);
// Stop permission inheritance
document.setInheritsPermissions(false);
// Give a specific group the SiteCollaborator permission
document.setPermission("SiteCollaborator", "GROUP_docs_cliente_empreendimento");
// If needed, it is possible to clean all the custom defined permissions
siteService.cleanSitePermissions(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment