Package org.ametys.plugins.repository
Class ACLAmetysObjectProfileAssignmentStorage
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.repository.ACLAmetysObjectProfileAssignmentStorage
- All Implemented Interfaces:
ProfileAssignmentStorage,LogEnabled,Prioritizable,Supporter<Object>
- Direct Known Subclasses:
ModifiableACLAmetysObjectProfileAssignmentStorage
public class ACLAmetysObjectProfileAssignmentStorage
extends AbstractLogEnabled
implements ProfileAssignmentStorage
Implementation of
ProfileAssignmentStorage for ACLAmetysObjects which stores profile assignments in subnodes of the node representing this object.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.right.ProfileAssignmentStorage
ProfileAssignmentStorage.AnonymousOrAnyConnectedKeys, ProfileAssignmentStorage.UserOrGroup -
Field Summary
Fields inherited from interface org.ametys.core.right.ProfileAssignmentStorage
MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllAssignmentsForAnonymousAndAnyConnectedUser(Set<? extends Object> rootContexts, String profileId) Get all contexts with a permission for the profile for anonymous AND any connected usergetAllAssignmentsForGroups(Set<? extends Object> rootContexts, String profileId) Get all contexts with a permission for the profile for a groupgetAllAssignmentsForUsers(Set<? extends Object> rootContexts, String profileId) Get all contexts with a permission for the profile for a usergetAllProfilesForAnonymousAndAnyConnectedUser(Set<? extends Object> rootContexts) Gets all contexts with stored profiles (allowed or denied) for anonymous or any connected user and for each, a description of the permissions.getAllProfilesForGroups(Set<? extends Object> rootContexts, Set<GroupIdentity> groups) Gets all contexts with stored profiles (allowed or denied) for the groups and for each, a description of the permissions.getAllProfilesForUser(Set<? extends Object> rootContexts, UserIdentity user) Gets all contexts with stored profiles (allowed or denied) for the user and for each, a description of the permissions.intGet the priority for the component.Gets the allowed profiles any connected user has on the given objectgetProfilesForGroups(Object object, Set<GroupIdentity> groups) Gets the groups that have allowed profiles assigned on the given objectgetProfilesForUsers(Object object, UserIdentity user) Gets the users that have allowed profiles assigned on the given objecthasAnonymousAnyAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds) Returns some profiles that are matching if anonymous user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedhasAnyConnectedAnyAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds) Returns some profiles that are matching if any connected user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedhasGroupAnyAllowedProfile(Set<? extends Object> rootContexts, Set<GroupIdentity> groups, Set<String> profileIds) Returns some profiles that are matching if group has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedhasUserAnyAllowedProfile(Set<? extends Object> rootContexts, UserIdentity user, Set<String> profileIds) Returns some profiles that are matching if user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedbooleanisInheritanceDisallowed(Object object) Returns true if the inheritance of permissions is disallowed on the given objectbooleanisRootContextSupported(Object rootContext) Returns true if this profile storage supports the given object as a root context i.e.booleanCheck if an element is supportedMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
ACLAmetysObjectProfileAssignmentStorage
-
-
Method Details
-
hasUserAnyAllowedProfile
public Set<String> hasUserAnyAllowedProfile(Set<? extends Object> rootContexts, UserIdentity user, Set<String> profileIds) Description copied from interface:ProfileAssignmentStorageReturns some profiles that are matching if user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasUserAnyAllowedProfilein interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights foruser- The user to testprofileIds- The ids of the profiles- Returns:
- If the Set is empty, it means any connected user has no matching profile.
If the Set is non empty, it contains at least one of the given profile BUT it may not contains all the matching profiles for anyconnected user AND it can contains some other profiles that were not in the given profiles
-
hasGroupAnyAllowedProfile
public Set<String> hasGroupAnyAllowedProfile(Set<? extends Object> rootContexts, Set<GroupIdentity> groups, Set<String> profileIds) Description copied from interface:ProfileAssignmentStorageReturns some profiles that are matching if group has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasGroupAnyAllowedProfilein interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights forgroups- The groups to test (a single group needs to match)profileIds- The ids of the profiles- Returns:
- If the Set is empty, it means the group has no matching profile.
If the Set is non empty, it contains at least one of the given profile BUT it may not contains all the matching profiles for the group AND it can contains some other profiles that were not in the given profiles
-
hasAnyConnectedAnyAllowedProfile
public Set<String> hasAnyConnectedAnyAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds) Description copied from interface:ProfileAssignmentStorageReturns some profiles that are matching if any connected user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasAnyConnectedAnyAllowedProfilein interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights forprofileIds- The ids of the profiles- Returns:
- If the Set is empty, it means the user has no matching profile.
If the Set is non empty, it contains at least one of the given profile BUT it may not contains all the matching profiles for the user AND it can contains some other profiles that were not in the given profiles
-
hasAnonymousAnyAllowedProfile
public Set<String> hasAnonymousAnyAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds) Description copied from interface:ProfileAssignmentStorageReturns some profiles that are matching if anonymous user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasAnonymousAnyAllowedProfilein interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights forprofileIds- The ids of the profiles- Returns:
- If the Set is empty, it means anonymous has no matching profile.
If the Set is non empty, it contains at least one of the given profile BUT it may not contains all the matching profiles for anonymous AND it can contains some other profiles that were not in the given profiles
-
getAllProfilesForAnonymousAndAnyConnectedUser
public Map<Object,Map<ProfileAssignmentStorage.AnonymousOrAnyConnectedKeys, getAllProfilesForAnonymousAndAnyConnectedUserSet<String>>> (Set<? extends Object> rootContexts) Description copied from interface:ProfileAssignmentStorageGets all contexts with stored profiles (allowed or denied) for anonymous or any connected user and for each, a description of the permissions.- Specified by:
getAllProfilesForAnonymousAndAnyConnectedUserin interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights for- Returns:
- a map associating a context object to the stored profiles for each permission
-
getAllProfilesForGroups
public Map<Object,Map<GroupIdentity, getAllProfilesForGroupsMap<ProfileAssignmentStorage.UserOrGroup, Set<String>>>> (Set<? extends Object> rootContexts, Set<GroupIdentity> groups) Description copied from interface:ProfileAssignmentStorageGets all contexts with stored profiles (allowed or denied) for the groups and for each, a description of the permissions. The permissions are grouped by group identity to be able to discriminate which group give what permissions.- Specified by:
getAllProfilesForGroupsin interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights forgroups- The group to get profiles for.- Returns:
- The map of context with their assigned allowed/denied profiles grouped by group identity
-
getAllProfilesForUser
public Map<Object,Map<ProfileAssignmentStorage.UserOrGroup, getAllProfilesForUserSet<String>>> (Set<? extends Object> rootContexts, UserIdentity user) Description copied from interface:ProfileAssignmentStorageGets all contexts with stored profiles (allowed or denied) for the user and for each, a description of the permissions.- Specified by:
getAllProfilesForUserin interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights foruser- The user to get profiles for.- Returns:
- The map of context with their assigned allowed/denied profiles
-
getAllAssignmentsForAnonymousAndAnyConnectedUser
public Map<Object,Set<ProfileAssignmentStorage.AnonymousOrAnyConnectedKeys>> getAllAssignmentsForAnonymousAndAnyConnectedUser(Set<? extends Object> rootContexts, String profileId) Description copied from interface:ProfileAssignmentStorageGet all contexts with a permission for the profile for anonymous AND any connected user- Specified by:
getAllAssignmentsForAnonymousAndAnyConnectedUserin interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights forprofileId- the profile id- Returns:
- a map of the permissions for each context
-
getAllAssignmentsForUsers
public Map<Object,Map<UserIdentity, getAllAssignmentsForUsersSet<ProfileAssignmentStorage.UserOrGroup>>> (Set<? extends Object> rootContexts, String profileId) Description copied from interface:ProfileAssignmentStorageGet all contexts with a permission for the profile for a user- Specified by:
getAllAssignmentsForUsersin interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights forprofileId- the profile id- Returns:
- a map of the user's permission for each context
-
getAllAssignmentsForGroups
public Map<Object,Map<GroupIdentity, getAllAssignmentsForGroupsSet<ProfileAssignmentStorage.UserOrGroup>>> (Set<? extends Object> rootContexts, String profileId) Description copied from interface:ProfileAssignmentStorageGet all contexts with a permission for the profile for a group- Specified by:
getAllAssignmentsForGroupsin interfaceProfileAssignmentStorage- Parameters:
rootContexts- The root contexts to search rights forprofileId- the profile id- Returns:
- a map of the group's permission for each context
-
getProfilesForAnonymousAndAnyConnectedUser
public Map<ProfileAssignmentStorage.AnonymousOrAnyConnectedKeys,Set<String>> getProfilesForAnonymousAndAnyConnectedUser(Object object) Description copied from interface:ProfileAssignmentStorageGets the allowed profiles any connected user has on the given object- Specified by:
getProfilesForAnonymousAndAnyConnectedUserin interfaceProfileAssignmentStorage- Parameters:
object- The object- Returns:
- a map containing allowed/denied profiles that anonymous and any connected user has on the given object
-
getProfilesForUsers
public Map<UserIdentity,Map<ProfileAssignmentStorage.UserOrGroup, getProfilesForUsersSet<String>>> (Object object, UserIdentity user) Description copied from interface:ProfileAssignmentStorageGets the users that have allowed profiles assigned on the given object- Specified by:
getProfilesForUsersin interfaceProfileAssignmentStorage- Parameters:
object- The object to testuser- The user to get profiles for. Can be null to get profiles for all users that have rights- Returns:
- The map of allowed users with their assigned allowed/denied profiles
-
getProfilesForGroups
public Map<GroupIdentity,Map<ProfileAssignmentStorage.UserOrGroup, getProfilesForGroupsSet<String>>> (Object object, Set<GroupIdentity> groups) Description copied from interface:ProfileAssignmentStorageGets the groups that have allowed profiles assigned on the given object- Specified by:
getProfilesForGroupsin interfaceProfileAssignmentStorage- Parameters:
object- The object to testgroups- The group to get profiles for. Can be null to get profiles for all groups that have rights- Returns:
- The map of allowed/denied groups with their assigned profiles
-
isInheritanceDisallowed
Description copied from interface:ProfileAssignmentStorageReturns true if the inheritance of permissions is disallowed on the given object- Specified by:
isInheritanceDisallowedin interfaceProfileAssignmentStorage- Parameters:
object- The object to test- Returns:
- true if the inheritance of permissions is disallowed on the given object
-
supports
Description copied from interface:SupporterCheck if an element is supported -
isRootContextSupported
Description copied from interface:ProfileAssignmentStorageReturns true if this profile storage supports the given object as a root context i.e. it can seek any permission under this object- Specified by:
isRootContextSupportedin interfaceProfileAssignmentStorage- Parameters:
rootContext- The object to start searching- Returns:
- true if this profile storage support this a as root context to search in
-
getPriority
Description copied from interface:PrioritizableGet the priority for the component. On components usingPrioritizableinterface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriorityin interfacePrioritizable- Returns:
- the priority
-