public class PrincipalHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PrincipalHelper.EmailCollector |
Constructor and Description |
---|
PrincipalHelper(UserManager userManager,
PermissionProvider permissionProvider) |
Modifier and Type | Method and Description |
---|---|
void |
collectObjectsFromGroup(String groupId,
boolean resolveGroups,
org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) |
HashSet<?> |
collectObjectsMatchingPermission(DocumentModel input,
String permission,
boolean ignoreGroups,
boolean resolveGroups,
org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) |
Set<String> |
getEmailsForPermission(DocumentModel input,
String permission,
boolean ignoreGroups) |
Set<String> |
getEmailsFromGroup(String groupId,
boolean resolveGroups) |
String[] |
getPermissionsToCheck(String permission) |
Set<NuxeoPrincipal> |
getPrincipalsForPermission(DocumentModel input,
String permission,
boolean ignoreGroups,
boolean resolveGroups) |
Set<NuxeoPrincipal> |
getPrincipalsFromGroup(String groupId,
boolean resolveGroups) |
Set<String> |
getUserAndGroupIdsForPermission(DocumentModel input,
String permission,
boolean ignoreGroups,
boolean resolveGroups,
boolean prefixIds)
Resolves the list of identifiers for users and groups who have the given permission on given document.
|
Set<String> |
getUserNamesFromGroup(String groupId,
boolean resolveGroups,
boolean prefixIds) |
boolean |
permissionMatch(String[] perms,
String perm) |
void |
resolveGroups(NuxeoGroup group,
org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) |
public PrincipalHelper(UserManager userManager, PermissionProvider permissionProvider)
public Set<String> getEmailsForPermission(DocumentModel input, String permission, boolean ignoreGroups) throws ClientException
ClientException
public Set<String> getUserAndGroupIdsForPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups, boolean prefixIds) throws ClientException
input
- document model to resolve users and groups on.permission
- the permission to checkignoreGroups
- if true, will ignore groups in resolution of idsresolveGroups
- if true, will resolve user members, iterating in the hierarchy of groupsprefixIds
- if true, will prefix identifiers with NuxeoPrincipal.PREFIX
and
NuxeoGroup.PREFIX
ClientException
public Set<NuxeoPrincipal> getPrincipalsForPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups) throws ClientException
ClientException
public Set<String> getEmailsFromGroup(String groupId, boolean resolveGroups) throws ClientException
ClientException
public Set<NuxeoPrincipal> getPrincipalsFromGroup(String groupId, boolean resolveGroups) throws ClientException
ClientException
public Set<String> getUserNamesFromGroup(String groupId, boolean resolveGroups, boolean prefixIds) throws ClientException
ClientException
public void collectObjectsFromGroup(String groupId, boolean resolveGroups, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) throws ClientException
ClientException
public HashSet<?> collectObjectsMatchingPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) throws ClientException
ClientException
public void resolveGroups(NuxeoGroup group, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) throws ClientException
ClientException
Copyright © 2015 Nuxeo SA. All rights reserved.