Class PrincipalHelper
java.lang.Object
org.nuxeo.ecm.automation.features.PrincipalHelper
Provides helper methods to find extract permissions/principals info from documents.
- Author:
- Bogdan Stefanescu, Anahide Tchertchian
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPrincipalHelper
(UserManager userManager, PermissionProvider permissionProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) getEmailsForPermission
(DocumentModel input, String permission, boolean ignoreGroups) getEmailsFromGroup
(String groupId, boolean resolveGroups) String[]
getPermissionsToCheck
(String permission) getPrincipalsForPermission
(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups) getPrincipalsFromGroup
(String groupId, boolean resolveGroups) 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.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)
-
Field Details
-
userManager
-
permissionProvider
-
-
Constructor Details
-
PrincipalHelper
-
-
Method Details
-
getEmailsForPermission
public Set<String> getEmailsForPermission(DocumentModel input, String permission, boolean ignoreGroups) -
getUserAndGroupIdsForPermission
public 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.- Parameters:
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 withNuxeoPrincipal.PREFIX
andNuxeoGroup.PREFIX
-
getPrincipalsForPermission
public Set<NuxeoPrincipal> getPrincipalsForPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups) -
getEmailsFromGroup
-
getPrincipalsFromGroup
-
getUserNamesFromGroup
-
collectObjectsFromGroup
public void collectObjectsFromGroup(String groupId, boolean resolveGroups, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) -
collectObjectsMatchingPermission
public HashSet<?> collectObjectsMatchingPermission(DocumentModel input, String permission, boolean ignoreGroups, boolean resolveGroups, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) -
resolveGroups
public void resolveGroups(NuxeoGroup group, org.nuxeo.ecm.automation.features.PrincipalHelper.Collector<?> collector) -
getPermissionsToCheck
-
permissionMatch
-