Last active
February 27, 2018 15:22
-
-
Save douglascrp/90595a4ec8016346ff96 to your computer and use it in GitHub Desktop.
Ajustar permissão de usuário
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//var usuario = people.getPerson("gestaoonline"); | |
//logger.warn(usuario.properties["cm:userName"]); | |
var sites = siteService.getSites("", "", -1); | |
logger.warn(sites.length); | |
for (var i = 0; i < sites.length; i++) { | |
var site = sites[i]; | |
logger.warn(site.getTitle()); | |
site.setMembership("gestaoonline", "SiteConsumer"); //"SiteManager", "SiteCollaborator", "SiteContributor", "SiteConsumer" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// localizar o usuário | |
var usuario = people.getPerson("usuario2.1"); | |
logger.warn(usuario.properties.userName); | |
// permissao customizada, remove o READ de EVERYONE | |
usuario.setInheritsPermissions(false); | |
// autorizar o acesso ao nó do usuário somente para usuários do(s) site(s) desejado | |
usuario.setPermission("Read", "GROUP_site_site2"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment