Interface IPrincipalManager

    • Method Detail

      • getPortalUserMembers

        Set<String> getPortalUserMembers​(SessionConfig sessionConfig,
                                         String principalId,
                                         ITransaction transaction)
                                  throws PortalException
        Returns the members that are (portal) users of the given principal.
        The return value will be:
        • If the given principal is a user: a set with a single entry that is the given user itself.
        • If the given principal is a user segmentation: a set with the users that are members of the given segmentation.
        • If the given principal is a group: a set containing the result of a recursion in this method with each direct member of the given group.
        Parameters:
        sessionConfig - the user's session.
        principalId - the principal identifier.
        transaction - the transaction.
        Returns:
        the members that are (portal) users of the given principal.
        Throws:
        PortalException
        Since:
        11.2.0
      • getPrincipals

        Set<String> getPrincipals​(SessionConfig sessionConfig,
                                  String principalId,
                                  ITransaction transaction)
                           throws PortalException
        Returns the principals of the given principal.
        The return value will be:
        • If the given principal is a user: a set with an entry that is the given user itself and the result of the recursion in this method for each group and segmentation the user is member of. The segmentations will not be calculated if the given principal is the guest user and there is no current monitor user in current thread.
        • If the given principal is a user segmentation: a set with the given segmentation and the result of the recursion in this method with each group the given segmentation is member of.
        • If the given principal is a group: a set containing the given group and the result of a recursion in this method with each group the given group is member of.
        Parameters:
        sessionConfig - the user's session.
        principalId - the principal identifier.
        transaction - the transaction.
        Returns:
        the principals of the given principal.
        Throws:
        PortalException
        Since:
        11.2.0
      • isMember

        boolean isMember​(SessionConfig sessionConfig,
                         String portalUserId,
                         Collection<String> principalIds,
                         ITransaction transaction)
                  throws PortalException
        Check whether the principal is a member of any given principal.
        Parameters:
        sessionConfig - the sesssion config.
        portalUserId - the identifier of user.
        principalIds - the identifiers of principals.
        transaction - the transaction.
        Returns:
        true whether the principal is member, otherwise false.
        Throws:
        PortalException
        Since:
        11.2.0