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
- Direct Known Subclasses:
ModifiableACLAmetysObjectProfileAssignmentStorage
public class ACLAmetysObjectProfileAssignmentStorage extends AbstractLogEnabled implements ProfileAssignmentStorage
Implementation ofProfileAssignmentStorage
forACLAmetysObject
s which stores profile assignments in subnodes of the node representing this object.
-
-
Field Summary
-
Fields inherited from interface org.ametys.core.right.ProfileAssignmentStorage
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ACLAmetysObjectProfileAssignmentStorage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<GroupIdentity>
getAllowedGroups(Object object, String profileId)
Gets the groups that have the given allowed profile on the given objectSet<String>
getAllowedProfilesForAnonymous(Object object)
Gets the allowed profiles an anonymous user has on the given objectSet<String>
getAllowedProfilesForAnyConnectedUser(Object object)
Gets the allowed profiles any connected user has on the given objectMap<GroupIdentity,Set<String>>
getAllowedProfilesForGroups(Object object)
Gets the groups that have allowed profiles assigned on the given objectSet<String>
getAllowedProfilesForUser(UserIdentity user, Object object)
Get the allowed profiles assigned on the given object for the given userMap<UserIdentity,Set<String>>
getAllowedProfilesForUsers(Object object)
Gets the users that have allowed profiles assigned on the given objectSet<UserIdentity>
getAllowedUsers(Object object, String profileId)
Gets the users that have the given allowed profile on the given objectSet<GroupIdentity>
getDeniedGroups(Object object, String profileId)
Gets the groups that have the given denied profile on the given objectSet<String>
getDeniedProfilesForAnonymous(Object object)
Gets the denied profiles an anonymous user has on the given objectSet<String>
getDeniedProfilesForAnyConnectedUser(Object object)
Gets the denied profiles any connected user has on the given objectMap<GroupIdentity,Set<String>>
getDeniedProfilesForGroups(Object object)
Gets the groups that have denied profiles assigned on the given objectSet<String>
getDeniedProfilesForUser(UserIdentity user, Object object)
Get the denied profiles assigned on the given object for the given userMap<UserIdentity,Set<String>>
getDeniedProfilesForUsers(Object object)
Gets the users that have denied profiles assigned on the given objectSet<UserIdentity>
getDeniedUsers(Object object, String profileId)
Gets the users that have the given denied profile on the given objectint
getPriority()
Returns the priority of this profile storage TheProfileAssignmentStorageExtensionPoint
will take the profile storage which supports the object with the highest priority to return the allowed/denied users/groupsboolean
hasAnonymousAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Returns true if anonymous user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
hasAnonymousDeniedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Returns true if anonymous user has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
hasAnyConnectedAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Returns true if any connected user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
hasAnyConnectedDeniedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Returns true if any connected user has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
hasGroupAllowedProfile(Set<? extends Object> rootContexts, GroupIdentity group, Set<String> profileIds)
Returns true if group has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
hasGroupDeniedProfile(Set<? extends Object> rootContexts, GroupIdentity group, Set<String> profileIds)
Returns true if group has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
hasUserAllowedProfile(Set<? extends Object> rootContexts, UserIdentity user, Set<String> profileIds)
Returns true if user has the allowed profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
hasUserDeniedProfile(Set<? extends Object> rootContexts, UserIdentity user, Set<String> profileIds)
Returns true if user has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmittedboolean
isAnonymousAllowed(Object object, String profileId)
Returns true if anonymous is allowed with the given profileboolean
isAnonymousDenied(Object object, String profileId)
Returns true if anonymous is denied with the given profileboolean
isAnyConnectedUserAllowed(Object object, String profileId)
Returns true if any connected user is allowed with the given profileboolean
isAnyConnectedUserDenied(Object object, String profileId)
Returns true if any connected user is denied with the given profileboolean
isInheritanceDisallowed(Object object)
Returns true if the inheritance of permissions is disallowed on the given objectboolean
isRootContextSupported(Object rootContext)
Returns true if this profile storage supports the given object as a root context i.e.boolean
isSupported(Object object)
Returns true if this profile storage supports the given object, i.e.-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
ACLAmetysObjectProfileAssignmentStorage
public ACLAmetysObjectProfileAssignmentStorage()
-
-
Method Detail
-
hasUserDeniedProfile
public boolean hasUserDeniedProfile(Set<? extends Object> rootContexts, UserIdentity user, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true if user has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasUserDeniedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights foruser
- The user to testprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
hasUserAllowedProfile
public boolean hasUserAllowedProfile(Set<? extends Object> rootContexts, UserIdentity user, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true 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:
hasUserAllowedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights foruser
- The user to testprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
hasGroupDeniedProfile
public boolean hasGroupDeniedProfile(Set<? extends Object> rootContexts, GroupIdentity group, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true if group has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasGroupDeniedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights forgroup
- The group to testprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
hasGroupAllowedProfile
public boolean hasGroupAllowedProfile(Set<? extends Object> rootContexts, GroupIdentity group, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true 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:
hasGroupAllowedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights forgroup
- The group to testprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
hasAnyConnectedDeniedProfile
public boolean hasAnyConnectedDeniedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true if any connected user has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasAnyConnectedDeniedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights forprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
hasAnyConnectedAllowedProfile
public boolean hasAnyConnectedAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true 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:
hasAnyConnectedAllowedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights forprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
hasAnonymousDeniedProfile
public boolean hasAnonymousDeniedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true if anonymous user has the denied profile for any given root context (or any sub context), given some profiles.
Only supported objects are transmitted- Specified by:
hasAnonymousDeniedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights forprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
hasAnonymousAllowedProfile
public boolean hasAnonymousAllowedProfile(Set<? extends Object> rootContexts, Set<String> profileIds)
Description copied from interface:ProfileAssignmentStorage
Returns true 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:
hasAnonymousAllowedProfile
in interfaceProfileAssignmentStorage
- Parameters:
rootContexts
- The root contexts to search rights forprofileIds
- The ids of the profiles- Returns:
- true if any connected user has a permission on at least one object supported by this profile assignment storage, given some groups and profiles
-
getAllowedProfilesForAnyConnectedUser
public Set<String> getAllowedProfilesForAnyConnectedUser(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the allowed profiles any connected user has on the given object- Specified by:
getAllowedProfilesForAnyConnectedUser
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object- Returns:
- the allowed profiles any connected user has on the given object
-
isAnyConnectedUserAllowed
public boolean isAnyConnectedUserAllowed(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Returns true if any connected user is allowed with the given profile- Specified by:
isAnyConnectedUserAllowed
in interfaceProfileAssignmentStorage
- Parameters:
object
- The objectprofileId
- The id of the profile- Returns:
- true if any connected user is allowed with the given profile
-
getDeniedProfilesForAnyConnectedUser
public Set<String> getDeniedProfilesForAnyConnectedUser(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the denied profiles any connected user has on the given object- Specified by:
getDeniedProfilesForAnyConnectedUser
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object- Returns:
- the denied profiles any connected user has on the given object
-
isAnyConnectedUserDenied
public boolean isAnyConnectedUserDenied(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Returns true if any connected user is denied with the given profile- Specified by:
isAnyConnectedUserDenied
in interfaceProfileAssignmentStorage
- Parameters:
object
- The objectprofileId
- The id of the profile- Returns:
- true if any connected user is denied with the given profile
-
getAllowedProfilesForAnonymous
public Set<String> getAllowedProfilesForAnonymous(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the allowed profiles an anonymous user has on the given object- Specified by:
getAllowedProfilesForAnonymous
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object- Returns:
- the allowed profiles an anonymous user has on the given object
-
isAnonymousAllowed
public boolean isAnonymousAllowed(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Returns true if anonymous is allowed with the given profile- Specified by:
isAnonymousAllowed
in interfaceProfileAssignmentStorage
- Parameters:
object
- The objectprofileId
- The id of the profile- Returns:
- true if anonymous is allowed with the given profile
-
getDeniedProfilesForAnonymous
public Set<String> getDeniedProfilesForAnonymous(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the denied profiles an anonymous user has on the given object- Specified by:
getDeniedProfilesForAnonymous
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object- Returns:
- the denied profiles an anonymous user has on the given object
-
isAnonymousDenied
public boolean isAnonymousDenied(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Returns true if anonymous is denied with the given profile- Specified by:
isAnonymousDenied
in interfaceProfileAssignmentStorage
- Parameters:
object
- The objectprofileId
- The id of the profile- Returns:
- true if anonymous is denied with the given profile
-
getAllowedProfilesForUser
public Set<String> getAllowedProfilesForUser(UserIdentity user, Object object)
Description copied from interface:ProfileAssignmentStorage
Get the allowed profiles assigned on the given object for the given user- Specified by:
getAllowedProfilesForUser
in interfaceProfileAssignmentStorage
- Parameters:
user
- The userobject
- The object to test- Returns:
- The allowed profiles
-
getAllowedProfilesForUsers
public Map<UserIdentity,Set<String>> getAllowedProfilesForUsers(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the users that have allowed profiles assigned on the given object- Specified by:
getAllowedProfilesForUsers
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to test- Returns:
- The map of allowed users (keys) with their assigned profiles (values)
-
getAllowedUsers
public Set<UserIdentity> getAllowedUsers(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Gets the users that have the given allowed profile on the given object- Specified by:
getAllowedUsers
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to testprofileId
- The id of the profile- Returns:
- The allowed users with that profile on that object
-
getAllowedProfilesForGroups
public Map<GroupIdentity,Set<String>> getAllowedProfilesForGroups(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the groups that have allowed profiles assigned on the given object- Specified by:
getAllowedProfilesForGroups
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to test- Returns:
- The map of allowed groups (keys) with their assigned profiles (values)
-
getAllowedGroups
public Set<GroupIdentity> getAllowedGroups(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Gets the groups that have the given allowed profile on the given object- Specified by:
getAllowedGroups
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to testprofileId
- The id of the profile- Returns:
- The allowed groups with that profile on that object
-
getDeniedProfilesForUser
public Set<String> getDeniedProfilesForUser(UserIdentity user, Object object)
Description copied from interface:ProfileAssignmentStorage
Get the denied profiles assigned on the given object for the given user- Specified by:
getDeniedProfilesForUser
in interfaceProfileAssignmentStorage
- Parameters:
user
- The userobject
- The object to test- Returns:
- The denied profiles
-
getDeniedProfilesForUsers
public Map<UserIdentity,Set<String>> getDeniedProfilesForUsers(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the users that have denied profiles assigned on the given object- Specified by:
getDeniedProfilesForUsers
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to test- Returns:
- The map of denied users (keys) with their assigned profiles (values)
-
getDeniedUsers
public Set<UserIdentity> getDeniedUsers(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Gets the users that have the given denied profile on the given object- Specified by:
getDeniedUsers
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to testprofileId
- The id of the profile- Returns:
- The denied users with that profile on that object
-
getDeniedProfilesForGroups
public Map<GroupIdentity,Set<String>> getDeniedProfilesForGroups(Object object)
Description copied from interface:ProfileAssignmentStorage
Gets the groups that have denied profiles assigned on the given object- Specified by:
getDeniedProfilesForGroups
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to test- Returns:
- The map of denied groups (keys) with their assigned profiles (values)
-
getDeniedGroups
public Set<GroupIdentity> getDeniedGroups(Object object, String profileId)
Description copied from interface:ProfileAssignmentStorage
Gets the groups that have the given denied profile on the given object- Specified by:
getDeniedGroups
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to testprofileId
- The id of the profile- Returns:
- The denied groups with that profile on that object
-
isInheritanceDisallowed
public boolean isInheritanceDisallowed(Object object)
Description copied from interface:ProfileAssignmentStorage
Returns true if the inheritance of permissions is disallowed on the given object- Specified by:
isInheritanceDisallowed
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to test- Returns:
- true if the inheritance of permissions is disallowed on the given object
-
isSupported
public boolean isSupported(Object object)
Description copied from interface:ProfileAssignmentStorage
Returns true if this profile storage supports the given object, i.e. if it is able to retrieve the allowed users/groups on that object- Specified by:
isSupported
in interfaceProfileAssignmentStorage
- Parameters:
object
- The object to test- Returns:
- true if this profile storage supports the given object
-
isRootContextSupported
public boolean isRootContextSupported(Object rootContext)
Description copied from interface:ProfileAssignmentStorage
Returns 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:
isRootContextSupported
in interfaceProfileAssignmentStorage
- Parameters:
rootContext
- The object to start searching- Returns:
- true if this profile storage support this a as root context to search in
-
getPriority
public int getPriority()
Description copied from interface:ProfileAssignmentStorage
Returns the priority of this profile storage TheProfileAssignmentStorageExtensionPoint
will take the profile storage which supports the object with the highest priority to return the allowed/denied users/groups- Specified by:
getPriority
in interfaceProfileAssignmentStorage
- Returns:
- the priority of this profile storage
-
-