Package org.ametys.core.right
Class ProfileAssignmentStorageExtensionPoint
- java.lang.Object
- 
- org.ametys.runtime.plugin.component.AbstractLogEnabled
- 
- org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint<ProfileAssignmentStorage>
- 
- org.ametys.core.right.ProfileAssignmentStorageExtensionPoint
 
 
 
- 
- All Implemented Interfaces:
- LogEnabled,- ExtensionPoint<ProfileAssignmentStorage>,- Disposable,- Initializable,- Component,- Contextualizable,- Serviceable,- ThreadSafe
 
 public class ProfileAssignmentStorageExtensionPoint extends AbstractThreadSafeComponentExtensionPoint<ProfileAssignmentStorage> ExtensionPointhandlingProfileAssignmentStorages.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringROLEAvalon Role- 
Fields inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint_cocoonManager, _context, _manager
 
- 
 - 
Constructor SummaryConstructors Constructor Description ProfileAssignmentStorageExtensionPoint()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description private Optional<ModifiableProfileAssignmentStorage>_getFirstModifiableProfileAssignmentStorage(Object object)private Optional<ProfileAssignmentStorage>_getFirstProfileAssignmentStorage(Object object)private AccessController.AccessResult_getPermissionsByGroup(Map<ProfileAssignmentStorage.UserOrGroup,Set<String>> groupProfiles, Set<String> profileIds)private AccessController.AccessResult_getPermissionsByUser(Map<ProfileAssignmentStorage.UserOrGroup,Set<String>> userProfiles, Set<String> profileIds)private Set<String>_hasAnonymousAnyPermission(ProfileAssignmentStorage profileAssignmentStorage, Set<? extends Object> rootContexts, Set<String> profileIds)private Set<String>_hasAnyConnectedUserAnyPermission(ProfileAssignmentStorage profileAssignmentStorage, Set<? extends Object> rootContexts, Set<String> profileIds)private Set<String>_hasUserAnyPermission(ProfileAssignmentStorage profileAssignmentStorage, Set<? extends Object> rootContexts, UserIdentity user, Set<GroupIdentity> userGroups, Set<String> profileIds)private void_logResult(UserIdentity user, Set<GroupIdentity> userGroups, Object object, Map<String,AccessController.AccessResult> accessResultsByProfile)voidallowProfileToAnonymous(String profileId, Object context)Adds allowed profile an anonymous user has on the given objectvoidallowProfileToAnyConnectedUser(String profileId, Object context)Adds allowed profile any connected user has on the given objectvoidallowProfileToGroup(GroupIdentity group, String profileId, Object context)Allows a group to a profile on a given objectvoidallowProfileToUser(UserIdentity user, String profileId, Object context)Allows a user to a profile on a given objectvoiddenyProfileToAnonymous(String profileId, Object context)Adds denied profile an anonymous user has on the given objectvoiddenyProfileToAnyConnectedUser(String profileId, Object context)Adds denied profile any connected user has on the given objectvoiddenyProfileToGroup(GroupIdentity group, String profileId, Object context)Denies a group to a profile on a given objectvoiddenyProfileToUser(UserIdentity user, String profileId, Object context)Denies a user to a profile on a given objectvoiddisallowInheritance(Object context, boolean disallow)Allow or disallow the inheritance of permissions on a given contextAccessController.AccessResultgetPermissionForAnonymous(Set<String> profileIds, Object object)Gets the permissions for Anonymous for the given profilesAccessController.AccessResultgetPermissionForAnyConnectedUser(Set<String> profileIds, Object object)Gets the permissions for Anonymous for the given profilesMap<String,AccessController.AccessResult>getPermissions(UserIdentity user, Set<GroupIdentity> userGroups, Set<String> profileIds, Object object)Gets the permissions a user has, given some groups and profiles, on an object.Map<GroupIdentity,AccessController.AccessResult>getPermissionsByGroup(Set<String> profileIds, Object object)Gets the permission by group only on an object, according to the given profiles.Map<String,AccessController.AccessResult>getPermissionsByProfile(UserIdentity user, Set<GroupIdentity> userGroups, Object object)Gets the permissions a user has on an object, for every profile in the application.Map<UserIdentity,AccessController.AccessResult>getPermissionsByUser(Set<String> profileIds, Object object)Gets the permission by user only on an object, according to the given profiles.Map<ProfileAssignmentStorage.AnonymousOrAnyConnectedKeys,Set<String>>getProfilesForAnonymousAndAnyConnectedUser(Object context)Gets the allowed profiles any connected user has on the given objectMap<GroupIdentity,Map<ProfileAssignmentStorage.UserOrGroup,Set<String>>>getProfilesForGroups(Object context, Set<GroupIdentity> groups)Gets the groups that have allowed profiles assigned on the given objectMap<UserIdentity,Map<ProfileAssignmentStorage.UserOrGroup,Set<String>>>getProfilesForUsers(Object context, UserIdentity user)Gets the users that have allowed profiles assigned on the given objectSet<String>hasAnonymousAnyPermission(Set<? extends Object> rootContexts, Set<String> profileIds)Returns some profiles that are matching if anybody has a permission on at least one object, given some profilesSet<String>hasAnyConnectedUserAnyPermission(Set<? extends Object> rootContexts, Set<String> profileIds)Returns some profiles that are matching if any connected user has a permission on at least one object, given some profilesSet<String>hasUserAnyPermission(Set<? extends Object> rootContexts, UserIdentity user, Set<GroupIdentity> userGroups, Set<String> profileIds)Returns some profiles that are matching if the user has a permission on at least one object, given some groups and profilesbooleanisInheritanceDisallowed(Object context)Determines if the inheritance of permissions is disallowed on a given contextvoidremoveAllowedProfileFromAnonymous(String profileId, Object context)Removes allowed profile an anonymous user has on the given objectvoidremoveAllowedProfileFromAnyConnectedUser(String profileId, Object context)Removes allowed profile any connected user has on the given objectvoidremoveAllowedProfileFromGroup(GroupIdentity group, String profileId, Object context)Removes the association between a group and an allowed profile on a given objectvoidremoveAllowedProfileFromUser(UserIdentity user, String profileId, Object context)Removes the association between a user and an allowed profile on a given objectvoidremoveDeniedProfileFromAnonymous(String profileId, Object context)Removes denied profile an anonymous user has on the given objectvoidremoveDeniedProfileFromAnyConnectedUser(String profileId, Object context)Removes denied profile any connected user has on the given objectvoidremoveDeniedProfileFromGroup(GroupIdentity group, String profileId, Object context)Removes the association between a group and a denied profile on a given objectvoidremoveDeniedProfileFromUser(UserIdentity user, String profileId, Object context)Removes the association between a user and a denied profile on a given object- 
Methods inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPointaddComponent, addExtension, contextualize, dispose, getExtension, getExtensionsIds, hasExtension, initialize, initializeExtensions, service
 - 
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
 
- 
 
- 
- 
- 
Constructor Detail- 
ProfileAssignmentStorageExtensionPointpublic ProfileAssignmentStorageExtensionPoint() 
 
- 
 - 
Method Detail- 
getPermissionspublic Map<String,AccessController.AccessResult> getPermissions(UserIdentity user, Set<GroupIdentity> userGroups, Set<String> profileIds, Object object) Gets the permissions a user has, given some groups and profiles, on an object.- Parameters:
- user- The user
- userGroups- The groups
- profileIds- The ids of the profiles
- object- The object
- Returns:
- the permissions a user has, given some groups and profiles on an object.
 
 - 
_logResultprivate void _logResult(UserIdentity user, Set<GroupIdentity> userGroups, Object object, Map<String,AccessController.AccessResult> accessResultsByProfile) 
 - 
hasUserAnyPermissionpublic Set<String> hasUserAnyPermission(Set<? extends Object> rootContexts, UserIdentity user, Set<GroupIdentity> userGroups, Set<String> profileIds) Returns some profiles that are matching if the user has a permission on at least one object, given some groups and profiles- Parameters:
- rootContexts- The root contexts object where to seek
- user- The user
- userGroups- The groups
- profileIds- 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
 
 - 
_hasUserAnyPermissionprivate Set<String> _hasUserAnyPermission(ProfileAssignmentStorage profileAssignmentStorage, Set<? extends Object> rootContexts, UserIdentity user, Set<GroupIdentity> userGroups, Set<String> profileIds) 
 - 
hasAnonymousAnyPermissionpublic Set<String> hasAnonymousAnyPermission(Set<? extends Object> rootContexts, Set<String> profileIds) Returns some profiles that are matching if anybody has a permission on at least one object, given some profiles- Parameters:
- rootContexts- The root contexts object where to seek
- profileIds- 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
 
 - 
_hasAnonymousAnyPermissionprivate Set<String> _hasAnonymousAnyPermission(ProfileAssignmentStorage profileAssignmentStorage, Set<? extends Object> rootContexts, Set<String> profileIds) 
 - 
hasAnyConnectedUserAnyPermissionpublic Set<String> hasAnyConnectedUserAnyPermission(Set<? extends Object> rootContexts, Set<String> profileIds) Returns some profiles that are matching if any connected user has a permission on at least one object, given some profiles- Parameters:
- rootContexts- The root contexts object where to seek
- profileIds- 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
 
 - 
_hasAnyConnectedUserAnyPermissionprivate Set<String> _hasAnyConnectedUserAnyPermission(ProfileAssignmentStorage profileAssignmentStorage, Set<? extends Object> rootContexts, Set<String> profileIds) 
 - 
getPermissionsByProfilepublic Map<String,AccessController.AccessResult> getPermissionsByProfile(UserIdentity user, Set<GroupIdentity> userGroups, Object object) Gets the permissions a user has on an object, for every profile in the application.- Parameters:
- user- The user
- userGroups- The groups
- object- The object
- Returns:
- the permissions a user has on an object, for every profile in the application.
 
 - 
getPermissionForAnonymouspublic AccessController.AccessResult getPermissionForAnonymous(Set<String> profileIds, Object object) Gets the permissions for Anonymous for the given profiles- Parameters:
- profileIds- The profiles to get permissions on
- object- The object
- Returns:
- the access result for each profile
 
 - 
getPermissionForAnyConnectedUserpublic AccessController.AccessResult getPermissionForAnyConnectedUser(Set<String> profileIds, Object object) Gets the permissions for Anonymous for the given profiles- Parameters:
- profileIds- The profiles to get permissions on
- object- The object
- Returns:
- the access result for each profile
 
 - 
_getPermissionsByUserprivate AccessController.AccessResult _getPermissionsByUser(Map<ProfileAssignmentStorage.UserOrGroup,Set<String>> userProfiles, Set<String> profileIds) 
 - 
getPermissionsByUserpublic Map<UserIdentity,AccessController.AccessResult> getPermissionsByUser(Set<String> profileIds, Object object) Gets the permission by user only on an object, according to the given profiles. It does not take account of the groups of the user, etc.- Parameters:
- profileIds- The ids of the profiles
- object- The object
- Returns:
- the permission by user only on an object, according to the given profiles
 
 - 
_getPermissionsByGroupprivate AccessController.AccessResult _getPermissionsByGroup(Map<ProfileAssignmentStorage.UserOrGroup,Set<String>> groupProfiles, Set<String> profileIds) 
 - 
getPermissionsByGrouppublic Map<GroupIdentity,AccessController.AccessResult> getPermissionsByGroup(Set<String> profileIds, Object object) Gets the permission by group only on an object, according to the given profiles.- Parameters:
- profileIds- The ids of the profiles
- object- The object
- Returns:
- the permission by group only on an object, according to the given profiles
 
 - 
getProfilesForAnonymousAndAnyConnectedUserpublic Map<ProfileAssignmentStorage.AnonymousOrAnyConnectedKeys,Set<String>> getProfilesForAnonymousAndAnyConnectedUser(Object context) Gets the allowed profiles any connected user has on the given object- Parameters:
- context- The object
- Returns:
- a map containing allowed/denied profiles that anonymous and any connected user has on the given object
 
 - 
getProfilesForUserspublic Map<UserIdentity,Map<ProfileAssignmentStorage.UserOrGroup,Set<String>>> getProfilesForUsers(Object context, UserIdentity user) Gets the users that have allowed profiles assigned on the given object- Parameters:
- context- The object to test
- user- 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
 
 - 
getProfilesForGroupspublic Map<GroupIdentity,Map<ProfileAssignmentStorage.UserOrGroup,Set<String>>> getProfilesForGroups(Object context, Set<GroupIdentity> groups) Gets the groups that have allowed profiles assigned on the given object- Parameters:
- context- The object to test
- groups- 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
 
 - 
allowProfileToAnyConnectedUserpublic void allowProfileToAnyConnectedUser(String profileId, Object context) Adds allowed profile any connected user has on the given object- Parameters:
- context- The object context
- profileId- The profile to add
 
 - 
denyProfileToAnyConnectedUserpublic void denyProfileToAnyConnectedUser(String profileId, Object context) Adds denied profile any connected user has on the given object- Parameters:
- profileId- The profile to add
- context- The object context
 
 - 
removeAllowedProfileFromAnyConnectedUserpublic void removeAllowedProfileFromAnyConnectedUser(String profileId, Object context) Removes allowed profile any connected user has on the given object- Parameters:
- profileId- The profile to remove
- context- The object context
 
 - 
removeDeniedProfileFromAnyConnectedUserpublic void removeDeniedProfileFromAnyConnectedUser(String profileId, Object context) Removes denied profile any connected user has on the given object- Parameters:
- context- The object context
- profileId- The profile to remove
 
 - 
allowProfileToAnonymouspublic void allowProfileToAnonymous(String profileId, Object context) Adds allowed profile an anonymous user has on the given object- Parameters:
- profileId- The profile to add
- context- The object context
 
 - 
denyProfileToAnonymouspublic void denyProfileToAnonymous(String profileId, Object context) Adds denied profile an anonymous user has on the given object- Parameters:
- profileId- The profile to add
- context- The object context
 
 - 
removeAllowedProfileFromAnonymouspublic void removeAllowedProfileFromAnonymous(String profileId, Object context) Removes allowed profile an anonymous user has on the given object- Parameters:
- profileId- The profile to remove
- context- The object context
 
 - 
removeDeniedProfileFromAnonymouspublic void removeDeniedProfileFromAnonymous(String profileId, Object context) Removes denied profile an anonymous user has on the given object- Parameters:
- context- The object context
- profileId- The profile to remove
 
 - 
allowProfileToUserpublic void allowProfileToUser(UserIdentity user, String profileId, Object context) Allows a user to a profile on a given object- Parameters:
- user- The user to add
- profileId- The id of the profile
- context- The object context
 
 - 
denyProfileToUserpublic void denyProfileToUser(UserIdentity user, String profileId, Object context) Denies a user to a profile on a given object- Parameters:
- user- The user to add
- profileId- The id of the profile
- context- The object context
 
 - 
removeAllowedProfileFromUserpublic void removeAllowedProfileFromUser(UserIdentity user, String profileId, Object context) Removes the association between a user and an allowed profile on a given object- Parameters:
- user- The user to remove
- context- The object context
- profileId- The id of the profile
 
 - 
removeDeniedProfileFromUserpublic void removeDeniedProfileFromUser(UserIdentity user, String profileId, Object context) Removes the association between a user and a denied profile on a given object- Parameters:
- user- The user to remove
- profileId- The id of the profile
- context- The object context
 
 - 
allowProfileToGrouppublic void allowProfileToGroup(GroupIdentity group, String profileId, Object context) Allows a group to a profile on a given object- Parameters:
- group- The group to add
- profileId- The id of the profile
- context- The object context
 
 - 
denyProfileToGrouppublic void denyProfileToGroup(GroupIdentity group, String profileId, Object context) Denies a group to a profile on a given object- Parameters:
- group- The group to add
- profileId- The id of the profile
- context- The object context
 
 - 
removeAllowedProfileFromGrouppublic void removeAllowedProfileFromGroup(GroupIdentity group, String profileId, Object context) Removes the association between a group and an allowed profile on a given object- Parameters:
- group- The group to remove
- profileId- The id of the profile
- context- The object context
 
 - 
removeDeniedProfileFromGrouppublic void removeDeniedProfileFromGroup(GroupIdentity group, String profileId, Object context) Removes the association between a group and a denied profile on a given object- Parameters:
- group- The group to remove
- profileId- The id of the profile
- context- The object context
 
 - 
isInheritanceDisallowedpublic boolean isInheritanceDisallowed(Object context) Determines if the inheritance of permissions is disallowed on a given context- Parameters:
- context- The object context
- Returns:
- true if the inheritance is disallowed
 
 - 
disallowInheritancepublic void disallowInheritance(Object context, boolean disallow) Allow or disallow the inheritance of permissions on a given context- Parameters:
- context- The object context
- disallow- true to disallow the inheritance
 
 - 
_getFirstProfileAssignmentStorageprivate Optional<ProfileAssignmentStorage> _getFirstProfileAssignmentStorage(Object object) 
 - 
_getFirstModifiableProfileAssignmentStorageprivate Optional<ModifiableProfileAssignmentStorage> _getFirstModifiableProfileAssignmentStorage(Object object) 
 
- 
 
-