Class ACLJCRAmetysObjectHelper
- java.lang.Object
-
- org.ametys.plugins.repository.jcr.ACLJCRAmetysObjectHelper
-
- All Implemented Interfaces:
Component,Serviceable
public class ACLJCRAmetysObjectHelper extends Object implements Component, Serviceable
Helper for implementingModifiableACLAmetysObjectin JCR under its node.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classACLJCRAmetysObjectHelper.ACLProfileExpression(package private) static classACLJCRAmetysObjectHelper.AllowedProfileExpression(package private) static classACLJCRAmetysObjectHelper.AnonymousAllowedProfileExpression(package private) static classACLJCRAmetysObjectHelper.AnonymousDeniedProfileExpression(package private) static classACLJCRAmetysObjectHelper.AnyConnectedAllowedProfileExpression(package private) static classACLJCRAmetysObjectHelper.AnyConnectedDeniedProfileExpression(package private) static classACLJCRAmetysObjectHelper.DeniedProfileExpression
-
Field Summary
Fields Modifier and Type Field Description private static String__NODE_NAME_ACL_GROUPSprivate static String__NODE_NAME_ACL_USERSprivate static String__NODE_NAME_ROOT_ACLprivate static String__NODETYPE_ACL_GROUPprivate static String__NODETYPE_ACL_USERprivate static String__NODETYPE_ROOT_ACLprivate static String__NODETYPE_UNSTRUCTUREDprivate static String__PROPERTY_NAME_ALLOWED_ANONYMOUS_PROFILESprivate static String__PROPERTY_NAME_ALLOWED_ANY_CONNECTED_PROFILESprivate static String__PROPERTY_NAME_ALLOWED_PROFILESprivate static String__PROPERTY_NAME_DENIED_ANONYMOUS_PROFILESprivate static String__PROPERTY_NAME_DENIED_ANY_CONNECTED_PROFILESprivate static String__PROPERTY_NAME_DENIED_PROFILESprivate static String__PROPERTY_NAME_DISALLOW_INHERITANCEprotected static Repository_repositoryThe repositoryprotected static AmetysObjectResolver_resolverThe AmetysObject resolver
-
Constructor Summary
Constructors Constructor Description ACLJCRAmetysObjectHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void_addProperty(Node node, String propertyName, String profileToAdd)private static void_checkLock(Node node)private static Set<String>_convertNodeToPath(Set<? extends Object> rootNodes)private static Node_getACLNode(Node node)protected static Set<String>_getAllowedProfiles(GroupIdentity group, String rootPath)Returns the allowed profiles for the group on any ACL Ametys object (and not denied on the same object)protected static Set<String>_getAllowedProfiles(UserIdentity user, String rootPath)Returns the allowed profiles for the user on any ACL Ametys object (and not denied on the same object)protected static Set<String>_getAnonymousAllowedProfiles(String rootPath)Returns the allowed profiles for anonymous on any ACL Ametys object (and not denied on the same object)protected static Set<String>_getAnyConnectedAllowedProfiles(String rootPath)Returns the allowed profiles for any connected user on any ACL Ametys object (and not denied on the same object)private static Node_getGroupsNode(Node node)private static Node_getOrCreateACLNode(Node node)private static Node_getOrCreateGroupNode(Node node, GroupIdentity groupIdentity)private static Node_getOrCreateGroupsNode(Node node)private static Node_getOrCreateUserNode(Node node, UserIdentity userIdentity)private static Node_getOrCreateUsersNode(Node node)private static Set<String>_getProperty(Node node, String propertyName)private static Node_getUserNode(Node node, UserIdentity user)private static Node_getUsersNode(Node node)private static NodeIterator_query(String jcrQuery)private static void_removeProperty(Node node, String propertyName, String profileToRemove)private static void_save(Node node)private static void_setProperty(Node node, String propertyName, Set<String> profiles)static voidaddAllowedGroups(Set<GroupIdentity> groups, Node node, String profileId)static voidaddAllowedProfilesForAnonymous(Node node, Set<String> profileIds)static voidaddAllowedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)static voidaddAllowedUsers(Set<UserIdentity> users, Node node, String profileId)static voidaddDeniedGroups(Set<GroupIdentity> groups, Node node, String profileId)static voidaddDeniedProfilesForAnonymous(Node node, Set<String> profileIds)static voidaddDeniedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)static voidaddDeniedUsers(Set<UserIdentity> users, Node node, String profileId)static voiddisallowInheritance(Node node, boolean disallow)static NodeIteratorgetACLGroups(GroupIdentity group, String rootPath)Returns all ACL objects for a given group (ametys:acl-group nodes)static NodeIteratorgetACLGroups(GroupIdentity group, String rootPath, Expression predicat)Returns all ACL objects for a given group (ametys:acl-group nodes)static NodeIteratorgetACLGroups(Expression predicat)Returns all ACL objects for groups (ametys:acl-group nodes)static NodeIteratorgetACLRoots(String rootPath)Returns all ACL root objects (ametys:acl nodes)static NodeIteratorgetACLRoots(String rootPath, Expression predicat)Returns all ACL root objects (ametys:acl nodes)static NodeIteratorgetACLUsers()Returns all ACL objects for users (ametys:acl-user nodes)static NodeIteratorgetACLUsers(UserIdentity user, String rootPath)Returns all ACL objects for a given user (ametys:acl-user nodes)static NodeIteratorgetACLUsers(UserIdentity user, String rootPath, Expression predicat)Returns all ACL objects for a given user (ametys:acl-user nodes)static NodeIteratorgetACLUsers(Expression predicat)Returns all ACL objects for users (ametys:acl-user nodes)static Set<GroupIdentity>getAllowedGroups(Node node, String profileId)Helper forACLAmetysObject.getAllowedGroups(String)static Set<String>getAllowedProfilesForAnonymous(Node node)static Set<String>getAllowedProfilesForAnyConnectedUser(Node node)static Map<GroupIdentity,Set<String>>getAllowedProfilesForGroups(Node node)static Set<String>getAllowedProfilesForUser(Node node, UserIdentity user)static Map<UserIdentity,Set<String>>getAllowedProfilesForUsers(Node node)Helper forACLAmetysObject.getAllowedProfilesForUsers()static Set<UserIdentity>getAllowedUsers(Node node, String profileId)Helper forACLAmetysObject.getAllowedUsers(String)static Set<GroupIdentity>getDeniedGroups(Node node, String profileId)Helper forACLAmetysObject.getDeniedGroups(String)static Set<String>getDeniedProfilesForAnonymous(Node node)static Set<String>getDeniedProfilesForAnyConnectedUser(Node node)static Map<GroupIdentity,Set<String>>getDeniedProfilesForGroups(Node node)Helper forACLAmetysObject.getDeniedProfilesForGroups()static Set<String>getDeniedProfilesForUser(Node node, UserIdentity user)static Map<UserIdentity,Set<String>>getDeniedProfilesForUsers(Node node)Helper forACLAmetysObject.getDeniedProfilesForUsers()static Set<UserIdentity>getDeniedUsers(Node node, String profileId)Helper forACLAmetysObject.getDeniedUsers(String)static booleanhasAnonymousAllowedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as allowed for anonymousstatic booleanhasAnonymousDeniedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as denied for anonymousstatic booleanhasAnyConnectedAllowedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as allowed for any connected userstatic booleanhasAnyConnectedDeniedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as denied for any connected userstatic booleanhasGroupAllowedProfile(Set<? extends Object> rootNodes, GroupIdentity group, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as allowed for the groupstatic booleanhasGroupDeniedProfile(Set<? extends Object> rootNodes, GroupIdentity group, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as denied for the groupstatic booleanhasUserAllowedProfile(Set<? extends Object> rootNodes, UserIdentity user, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as allowed for the userstatic booleanhasUserDeniedProfile(Set<? extends Object> rootNodes, UserIdentity user, Set<String> profileIds)Returns true if any ACL Ametys object has one of the given profiles as denied for the userstatic booleanisInheritanceDisallowed(Node node)Helper forACLAmetysObject.isInheritanceDisallowed()static voidremoveAllowedGroups(Set<GroupIdentity> groups, Node node)static voidremoveAllowedGroups(Set<GroupIdentity> groups, Node node, String profileId)static voidremoveAllowedProfilesForAnonymous(Node node, Set<String> profileIds)static voidremoveAllowedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)static voidremoveAllowedUsers(Set<UserIdentity> users, Node node)static voidremoveAllowedUsers(Set<UserIdentity> users, Node node, String profileId)static voidremoveDeniedGroups(Set<GroupIdentity> groups, Node node)static voidremoveDeniedGroups(Set<GroupIdentity> groups, Node node, String profileId)static voidremoveDeniedProfilesForAnonymous(Node node, Set<String> profileIds)static voidremoveDeniedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)static voidremoveDeniedUsers(Set<UserIdentity> users, Node node)static voidremoveDeniedUsers(Set<UserIdentity> users, Node node, String profileId)static voidremoveGroup(GroupIdentity group)static voidremoveProfile(String profileId)static voidremoveUser(UserIdentity user)voidservice(ServiceManager manager)
-
-
-
Field Detail
-
_resolver
protected static AmetysObjectResolver _resolver
The AmetysObject resolver
-
_repository
protected static Repository _repository
The repository
-
__NODE_NAME_ROOT_ACL
private static final String __NODE_NAME_ROOT_ACL
- See Also:
- Constant Field Values
-
__NODETYPE_ROOT_ACL
private static final String __NODETYPE_ROOT_ACL
- See Also:
- Constant Field Values
-
__NODE_NAME_ACL_USERS
private static final String __NODE_NAME_ACL_USERS
- See Also:
- Constant Field Values
-
__NODE_NAME_ACL_GROUPS
private static final String __NODE_NAME_ACL_GROUPS
- See Also:
- Constant Field Values
-
__NODETYPE_ACL_USER
private static final String __NODETYPE_ACL_USER
- See Also:
- Constant Field Values
-
__NODETYPE_ACL_GROUP
private static final String __NODETYPE_ACL_GROUP
- See Also:
- Constant Field Values
-
__NODETYPE_UNSTRUCTURED
private static final String __NODETYPE_UNSTRUCTURED
- See Also:
- Constant Field Values
-
__PROPERTY_NAME_ALLOWED_ANY_CONNECTED_PROFILES
private static final String __PROPERTY_NAME_ALLOWED_ANY_CONNECTED_PROFILES
- See Also:
- Constant Field Values
-
__PROPERTY_NAME_DENIED_ANY_CONNECTED_PROFILES
private static final String __PROPERTY_NAME_DENIED_ANY_CONNECTED_PROFILES
- See Also:
- Constant Field Values
-
__PROPERTY_NAME_ALLOWED_ANONYMOUS_PROFILES
private static final String __PROPERTY_NAME_ALLOWED_ANONYMOUS_PROFILES
- See Also:
- Constant Field Values
-
__PROPERTY_NAME_DENIED_ANONYMOUS_PROFILES
private static final String __PROPERTY_NAME_DENIED_ANONYMOUS_PROFILES
- See Also:
- Constant Field Values
-
__PROPERTY_NAME_ALLOWED_PROFILES
private static final String __PROPERTY_NAME_ALLOWED_PROFILES
- See Also:
- Constant Field Values
-
__PROPERTY_NAME_DENIED_PROFILES
private static final String __PROPERTY_NAME_DENIED_PROFILES
- See Also:
- Constant Field Values
-
__PROPERTY_NAME_DISALLOW_INHERITANCE
private static final String __PROPERTY_NAME_DISALLOW_INHERITANCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ACLJCRAmetysObjectHelper
public ACLJCRAmetysObjectHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
_convertNodeToPath
private static Set<String> _convertNodeToPath(Set<? extends Object> rootNodes)
-
hasUserDeniedProfile
public static boolean hasUserDeniedProfile(Set<? extends Object> rootNodes, UserIdentity user, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as denied for the user- Parameters:
user- The userprofileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as denied for the user
-
hasUserAllowedProfile
public static boolean hasUserAllowedProfile(Set<? extends Object> rootNodes, UserIdentity user, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as allowed for the user- Parameters:
user- The userprofileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as allowed for the user
-
hasGroupDeniedProfile
public static boolean hasGroupDeniedProfile(Set<? extends Object> rootNodes, GroupIdentity group, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as denied for the group- Parameters:
group- The groupprofileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as denied for the group
-
hasGroupAllowedProfile
public static boolean hasGroupAllowedProfile(Set<? extends Object> rootNodes, GroupIdentity group, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as allowed for the group- Parameters:
group- The groupprofileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as allowed for the group
-
hasAnyConnectedDeniedProfile
public static boolean hasAnyConnectedDeniedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as denied for any connected user- Parameters:
profileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as denied for any connected user
-
hasAnyConnectedAllowedProfile
public static boolean hasAnyConnectedAllowedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as allowed for any connected user- Parameters:
profileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as allowed for any connected user
-
hasAnonymousDeniedProfile
public static boolean hasAnonymousDeniedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as denied for anonymous- Parameters:
profileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as denied for anonymous
-
hasAnonymousAllowedProfile
public static boolean hasAnonymousAllowedProfile(Set<? extends Object> rootNodes, Set<String> profileIds)
Returns true if any ACL Ametys object has one of the given profiles as allowed for anonymous- Parameters:
profileIds- The ids of the profilesrootNodes- The JCR root nodes where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- true if any ACL Ametys object has one of the given profiles as allowed for anonymous
-
getACLRoots
public static NodeIterator getACLRoots(String rootPath)
Returns all ACL root objects (ametys:acl nodes)- Parameters:
rootPath- The root path to restrict the search. Can be null.- Returns:
- The ACL root objects
-
getACLRoots
public static NodeIterator getACLRoots(String rootPath, Expression predicat)
Returns all ACL root objects (ametys:acl nodes)- Parameters:
rootPath- The root path to restrict the search. Can be null.predicat- The predicat expression. Can be null.- Returns:
- The ACL root objects
-
getACLUsers
public static NodeIterator getACLUsers(UserIdentity user, String rootPath)
Returns all ACL objects for a given user (ametys:acl-user nodes)- Parameters:
user- The userrootPath- The root path to restrict the search. Can be null.- Returns:
- The ACL user objects for user
-
getACLUsers
public static NodeIterator getACLUsers(UserIdentity user, String rootPath, Expression predicat)
Returns all ACL objects for a given user (ametys:acl-user nodes)- Parameters:
user- The userrootPath- The root path to restrict the search. Can be null.predicat- The predicat expression. Can be null.- Returns:
- The ACL user objects for user
-
getACLUsers
public static NodeIterator getACLUsers()
Returns all ACL objects for users (ametys:acl-user nodes)- Returns:
- The ACL user objects for users
-
getACLUsers
public static NodeIterator getACLUsers(Expression predicat)
Returns all ACL objects for users (ametys:acl-user nodes)- Parameters:
predicat- The predicat expression. Can be null.- Returns:
- The ACL user objects for users
-
getACLGroups
public static NodeIterator getACLGroups(Expression predicat)
Returns all ACL objects for groups (ametys:acl-group nodes)- Parameters:
predicat- The predicat expression. Can be null.- Returns:
- The ACL group objects for groups
-
getACLGroups
public static NodeIterator getACLGroups(GroupIdentity group, String rootPath)
Returns all ACL objects for a given group (ametys:acl-group nodes)- Parameters:
group- The grouprootPath- The root path to restrict the search. Can be null.- Returns:
- The ACL user objects for groups
-
getACLGroups
public static NodeIterator getACLGroups(GroupIdentity group, String rootPath, Expression predicat)
Returns all ACL objects for a given group (ametys:acl-group nodes)- Parameters:
group- The grouprootPath- The root path to restrict the search. Can be null.predicat- The predicat expression. Can be null.- Returns:
- The ACL user objects for groups
-
_getAllowedProfiles
protected static Set<String> _getAllowedProfiles(UserIdentity user, String rootPath)
Returns the allowed profiles for the user on any ACL Ametys object (and not denied on the same object)- Parameters:
user- The userrootPath- The JCR root path where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- the allowed profiles for the user on any ACL Ametys object (and not denied on the same object)
-
_getAllowedProfiles
protected static Set<String> _getAllowedProfiles(GroupIdentity group, String rootPath)
Returns the allowed profiles for the group on any ACL Ametys object (and not denied on the same object)- Parameters:
group- The grouprootPath- The JCR root path where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- Returns the allowed profiles for the group on any ACL Ametys object (and not denied on the same object)
-
_getAnyConnectedAllowedProfiles
protected static Set<String> _getAnyConnectedAllowedProfiles(String rootPath)
Returns the allowed profiles for any connected user on any ACL Ametys object (and not denied on the same object)- Parameters:
rootPath- The JCR root path where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- the allowed profiles for any connected user on any ACL Ametys object (and not denied on the same object)
-
_getAnonymousAllowedProfiles
protected static Set<String> _getAnonymousAllowedProfiles(String rootPath)
Returns the allowed profiles for anonymous on any ACL Ametys object (and not denied on the same object)- Parameters:
rootPath- The JCR root path where starts the query search (must be something like "//element(myNode, ametys:collection)"), it will be the beginning of the JCR query. Can be null to not restrict the search.- Returns:
- the allowed profiles for anonymous on any ACL Ametys object (and not denied on the same object)
-
_query
private static NodeIterator _query(String jcrQuery)
-
getAllowedProfilesForAnyConnectedUser
public static Set<String> getAllowedProfilesForAnyConnectedUser(Node node)
- Parameters:
node- The JCR node for the Ametys object- Returns:
- the allowed profiles any connected user has on the given node
-
addAllowedProfilesForAnyConnectedUser
public static void addAllowedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to add
-
removeAllowedProfilesForAnyConnectedUser
public static void removeAllowedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to remove
-
getDeniedProfilesForAnyConnectedUser
public static Set<String> getDeniedProfilesForAnyConnectedUser(Node node)
- Parameters:
node- The JCR node for the Ametys object- Returns:
- the denied profiles any connected user has on the given node
-
addDeniedProfilesForAnyConnectedUser
public static void addDeniedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to add
-
removeDeniedProfilesForAnyConnectedUser
public static void removeDeniedProfilesForAnyConnectedUser(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to remove
-
getAllowedProfilesForAnonymous
public static Set<String> getAllowedProfilesForAnonymous(Node node)
- Parameters:
node- The JCR node for the Ametys object- Returns:
- the allowed profiles an anonymous user has on the given node
-
addAllowedProfilesForAnonymous
public static void addAllowedProfilesForAnonymous(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to add
-
removeAllowedProfilesForAnonymous
public static void removeAllowedProfilesForAnonymous(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to remove
-
getDeniedProfilesForAnonymous
public static Set<String> getDeniedProfilesForAnonymous(Node node)
- Parameters:
node- The JCR node for the Ametys object- Returns:
- the denied profiles an anonymous user has on the given node
-
addDeniedProfilesForAnonymous
public static void addDeniedProfilesForAnonymous(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to add
-
removeDeniedProfilesForAnonymous
public static void removeDeniedProfilesForAnonymous(Node node, Set<String> profileIds)
- Parameters:
node- The JCR node for the Ametys objectprofileIds- The profiles to remove
-
getAllowedProfilesForUser
public static Set<String> getAllowedProfilesForUser(Node node, UserIdentity user)
- Parameters:
node- The JCR node for the Ametys objectuser- The user- Returns:
- The denied profiles
-
getAllowedProfilesForUsers
public static Map<UserIdentity,Set<String>> getAllowedProfilesForUsers(Node node)
Helper forACLAmetysObject.getAllowedProfilesForUsers()- Parameters:
node- The JCR node for the Ametys object- Returns:
- The map of allowed users (keys) with their assigned profiles (values)
-
getAllowedUsers
public static Set<UserIdentity> getAllowedUsers(Node node, String profileId)
Helper forACLAmetysObject.getAllowedUsers(String)- Parameters:
node- The JCR node for the Ametys objectprofileId- The id of the profile- Returns:
- The allowed users with that profile on that ametys object
-
addAllowedUsers
public static void addAllowedUsers(Set<UserIdentity> users, Node node, String profileId)
- Parameters:
users- The users to addnode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeAllowedUsers
public static void removeAllowedUsers(Set<UserIdentity> users, Node node, String profileId)
- Parameters:
users- The users to removenode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeAllowedUsers
public static void removeAllowedUsers(Set<UserIdentity> users, Node node)
- Parameters:
users- The users to removenode- The JCR node for the Ametys object
-
getAllowedProfilesForGroups
public static Map<GroupIdentity,Set<String>> getAllowedProfilesForGroups(Node node)
- Parameters:
node- The JCR node for the Ametys object- Returns:
- The map of allowed groups (keys) with their assigned profiles (values)
-
getAllowedGroups
public static Set<GroupIdentity> getAllowedGroups(Node node, String profileId)
Helper forACLAmetysObject.getAllowedGroups(String)- Parameters:
node- The JCR node for the Ametys objectprofileId- The id of the profile- Returns:
- The allowed groups with that profile on that ametys object
-
addAllowedGroups
public static void addAllowedGroups(Set<GroupIdentity> groups, Node node, String profileId)
- Parameters:
groups- The groups to addnode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeAllowedGroups
public static void removeAllowedGroups(Set<GroupIdentity> groups, Node node, String profileId)
- Parameters:
groups- The groups to removenode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeAllowedGroups
public static void removeAllowedGroups(Set<GroupIdentity> groups, Node node)
- Parameters:
groups- The groups to removenode- The JCR node for the Ametys object
-
getDeniedProfilesForUser
public static Set<String> getDeniedProfilesForUser(Node node, UserIdentity user)
- Parameters:
node- The JCR node for the Ametys objectuser- The user- Returns:
- The denied profiles
-
getDeniedProfilesForUsers
public static Map<UserIdentity,Set<String>> getDeniedProfilesForUsers(Node node)
Helper forACLAmetysObject.getDeniedProfilesForUsers()- Parameters:
node- The JCR node for the Ametys object- Returns:
- The map of denied users (keys) with their assigned profiles (values)
-
getDeniedUsers
public static Set<UserIdentity> getDeniedUsers(Node node, String profileId)
Helper forACLAmetysObject.getDeniedUsers(String)- Parameters:
node- The JCR node for the Ametys objectprofileId- The id of the profile- Returns:
- The denied users with that profile on that ametys object
-
addDeniedUsers
public static void addDeniedUsers(Set<UserIdentity> users, Node node, String profileId)
- Parameters:
users- The users to addnode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeDeniedUsers
public static void removeDeniedUsers(Set<UserIdentity> users, Node node, String profileId)
- Parameters:
users- The users to removenode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeDeniedUsers
public static void removeDeniedUsers(Set<UserIdentity> users, Node node)
- Parameters:
users- The users to removenode- The JCR node for the Ametys object
-
getDeniedProfilesForGroups
public static Map<GroupIdentity,Set<String>> getDeniedProfilesForGroups(Node node)
Helper forACLAmetysObject.getDeniedProfilesForGroups()- Parameters:
node- The JCR node for the Ametys object- Returns:
- The map of denied groups (keys) with their assigned profiles (values)
-
getDeniedGroups
public static Set<GroupIdentity> getDeniedGroups(Node node, String profileId)
Helper forACLAmetysObject.getDeniedGroups(String)- Parameters:
node- The JCR node for the Ametys objectprofileId- The id of the profile- Returns:
- The denied groups with that profile on that ametys object
-
addDeniedGroups
public static void addDeniedGroups(Set<GroupIdentity> groups, Node node, String profileId)
- Parameters:
groups- The groups to addnode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeDeniedGroups
public static void removeDeniedGroups(Set<GroupIdentity> groups, Node node, String profileId)
- Parameters:
groups- The groups to removenode- The JCR node for the Ametys objectprofileId- The id of the profile
-
removeDeniedGroups
public static void removeDeniedGroups(Set<GroupIdentity> groups, Node node)
- Parameters:
groups- The groups to removenode- The JCR node for the Ametys object
-
removeProfile
public static void removeProfile(String profileId)
- Parameters:
profileId- The id of the profile
-
removeUser
public static void removeUser(UserIdentity user)
- Parameters:
user- The user
-
removeGroup
public static void removeGroup(GroupIdentity group)
- Parameters:
group- The group
-
isInheritanceDisallowed
public static boolean isInheritanceDisallowed(Node node)
Helper forACLAmetysObject.isInheritanceDisallowed()- Parameters:
node- The JCR node for the Ametys object- Returns:
- true if the inheritance is disallow of the given node
-
disallowInheritance
public static void disallowInheritance(Node node, boolean disallow)
- Parameters:
node- The JCR node for the Ametys objectdisallow- true to disallow the inheritance, false otherwise
-
_checkLock
private static void _checkLock(Node node) throws AmetysRepositoryException
- Throws:
AmetysRepositoryException
-
_getOrCreateACLNode
private static Node _getOrCreateACLNode(Node node)
-
_getACLNode
private static Node _getACLNode(Node node)
-
_getOrCreateUsersNode
private static Node _getOrCreateUsersNode(Node node)
-
_getUserNode
private static Node _getUserNode(Node node, UserIdentity user)
-
_getUsersNode
private static Node _getUsersNode(Node node)
-
_getOrCreateGroupsNode
private static Node _getOrCreateGroupsNode(Node node)
-
_getGroupsNode
private static Node _getGroupsNode(Node node)
-
_getOrCreateUserNode
private static Node _getOrCreateUserNode(Node node, UserIdentity userIdentity)
-
_getOrCreateGroupNode
private static Node _getOrCreateGroupNode(Node node, GroupIdentity groupIdentity)
-
_getProperty
private static Set<String> _getProperty(Node node, String propertyName)
-
_setProperty
private static void _setProperty(Node node, String propertyName, Set<String> profiles)
-
_addProperty
private static void _addProperty(Node node, String propertyName, String profileToAdd)
-
_removeProperty
private static void _removeProperty(Node node, String propertyName, String profileToRemove)
-
-