Interface IPrincipalManager

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(SessionConfig sessionConfig, PrincipalConfig principal, ITransaction transaction)
      Add a Principal.
      void delete​(SessionConfig sessionConfig, java.lang.String principalId, ITransaction transaction)
      Remove a Principal.
      PrincipalConfig get​(SessionConfig sessionConfig, java.lang.String principalId, ITransaction transaction)
      Get the Principal.
      PrincipalConfig getByShortId​(SessionConfig sessionConfig, java.lang.String shortId, ITransaction transaction)
      Get the Principal given the shortId.
      java.util.Set<java.lang.String> getPortalUserMembers​(SessionConfig sessionConfig, java.lang.String principalId, ITransaction transaction)
      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.
      java.util.Set<java.lang.String> getPrincipals​(SessionConfig sessionConfig, java.lang.String principalId, ITransaction transaction)
      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.
      boolean isMember​(SessionConfig sessionConfig, java.lang.String portalUserId, java.util.Collection<java.lang.String> principalIds, ITransaction transaction)
      Check whether the principal is a member of any given principal.
      void update​(SessionConfig sessionConfig, PrincipalConfig principal, ITransaction transaction)
      Update a Principal.
    • Method Detail

      • getPortalUserMembers

        java.util.Set<java.lang.String> getPortalUserMembers​(SessionConfig sessionConfig,
                                                             java.lang.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

        java.util.Set<java.lang.String> getPrincipals​(SessionConfig sessionConfig,
                                                      java.lang.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,
                         java.lang.String portalUserId,
                         java.util.Collection<java.lang.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