public class PrincipalHelper extends Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
PrincipalHelper.EmailCollector  | 
| Modifier and Type | Field and Description | 
|---|---|
protected PermissionProvider | 
permissionProvider  | 
protected UserManager | 
userManager  | 
| 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)  | 
protected UserManager userManager
protected PermissionProvider permissionProvider
public PrincipalHelper(UserManager userManager, PermissionProvider permissionProvider)
public Set<String> getEmailsForPermission(DocumentModel input, String permission, boolean ignoreGroups)
public Set<String> getUserAndGroupIdsForPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups, boolean prefixIds)
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.PREFIXpublic Set<NuxeoPrincipal> getPrincipalsForPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups)
public Set<String> getEmailsFromGroup(String groupId, boolean resolveGroups)
public Set<NuxeoPrincipal> getPrincipalsFromGroup(String groupId, boolean resolveGroups)
public Set<String> getUserNamesFromGroup(String groupId, boolean resolveGroups, boolean prefixIds)
public void collectObjectsFromGroup(String groupId, boolean resolveGroups, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector)
public HashSet<?> collectObjectsMatchingPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector)
public void resolveGroups(NuxeoGroup group, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector)
public String[] getPermissionsToCheck(String permission)
public boolean permissionMatch(String[] perms, String perm)
Copyright © 2019 Nuxeo. All rights reserved.