Package de.xima.fc.user.access
Interface UserInfoProvider
-
public interface UserInfoProviderProvides basic information about the formcycle user profile of a user.- Since:
- 8.5.0
- Author:
- Norman Lorenz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull Set<UserTenantMembership>getTenantMemberships(AuthenticatedUser user)Determines the tenant memberships for the given authenticated user.@NotNull Optional<UserInfo>getUserInfo(AuthenticatedUser user)Returns information about the user profile of the given authenticated user.@NotNull Optional<UserInfo>getUserInfoById(UserId userId)Returns information about the user profile with the given ID.
-
-
-
Method Detail
-
getTenantMemberships
@NotNull @NotNull Set<UserTenantMembership> getTenantMemberships(AuthenticatedUser user) throws FcIAMAccessException
Determines the tenant memberships for the given authenticated user. A user is a member of tenant if they have a role or permission assigned in that tenant. The method returns a set ofUserTenantMembershipobjects representing the tenant memberships for the user. If the user has no tenant memberships, an empty set is returned.- Parameters:
user- the authenticated user to determine the tenant memberships for- Returns:
- the set of tenant memberships for the given user; empty if the user has no tenant memberships
- Throws:
FcIAMAccessException- if an error occurs while determining the tenant memberships for the userIllegalArgumentException- if the provided user is null or invalid- Since:
- 8.6.0
-
getUserInfo
@NotNull @NotNull Optional<UserInfo> getUserInfo(AuthenticatedUser user) throws FcIAMAccessException
Returns information about the user profile of the given authenticated user.- Parameters:
user- the authenticated user- Returns:
- the user information, or an empty optional if the user has no formcycle user profile, e.g. the super user or the virtual system user
- Throws:
IllegalArgumentException- if the user isnullFcIAMAccessException- if the user cannot be resolved, e.g. because the pac4j profile is missing- Since:
- 8.5.0
-
getUserInfoById
@NotNull @NotNull Optional<UserInfo> getUserInfoById(UserId userId)
Returns information about the user profile with the given ID.- Parameters:
userId- the ID of the user profile- Returns:
- the user information, or an empty optional if no user profile with the given ID exists
- Throws:
IllegalArgumentException- if the user ID isnull- Since:
- 8.5.0
-
-