Interface UserInfoProvider


  • public interface UserInfoProvider
    Provides basic information about the formcycle user profile of a user.
    Since:
    8.5.0
    Author:
    Norman Lorenz
    • 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 of UserTenantMembership objects 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 user
        IllegalArgumentException - 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 is null
        FcIAMAccessException - 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 is null
        Since:
        8.5.0