Class Principal

    • Field Detail

      • DISPLAYNAME

        @Deprecated
        public static final java.lang.String DISPLAYNAME
        Deprecated.
        since ages - it is a dynamic attribute now
        Constant identifier for displayName attribute of User type.
        See Also:
        Constant Field Values
      • ALLSEARCHRESTRICTIONS

        @Deprecated
        public static final java.lang.String ALLSEARCHRESTRICTIONS
        Deprecated.
        since ages - it is a dynamic attribute now
        Constant identifier for allSearchRestrictions attribute of User type.
        See Also:
        Constant Field Values
      • PRINCIPAL_GROUP_RELATION_NAME

        @Deprecated
        public static final java.lang.String PRINCIPAL_GROUP_RELATION_NAME
        Deprecated.
        since ages - use instead CoreConstants.Relations.PRINCIPALGROUPRELATION
        Constant identifier for PrincipalGroupRelation type.
      • ALLGROUPS

        @Deprecated
        public static final java.lang.String ALLGROUPS
        Deprecated.
        since ages - Old Jalo attribute that is now dynamic.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Principal

        public Principal()
    • Method Detail

      • toString

        public java.lang.String toString()
        Description copied from class: Item
        Returns the String representation of this item. This is by default the representation of the primary key of this item.
        Overrides:
        toString in class Item
        Returns:
        the String representation of this item.
      • getUID

        @Deprecated
        public java.lang.String getUID()
        Deprecated.
        since ages - useGeneratedPrincipal.getUid() instead
        Gets the unique identifier of this principal.
      • getAllGroups

        public java.util.Set<PrincipalGroup> getAllGroups​(SessionContext ctx)
        Gets all groups this principal is member of ( transitive ! ).
        Returns:
        set of PrincipalGroups this principal is member of ( transitive ! )
      • isMemberOf

        @Deprecated
        public boolean isMemberOf​(PrincipalGroup grp,
                                  boolean includingSupergroups)
        Checks whether the principal is member of the given group or any of its subgroups.
        Parameters:
        includingSupergroups - if true indirect membership through group-in-group is evaluated, otherwise only direct membership
        grp - the group to check membership for
        Returns:
        true if this principal is member of the given group or any of its subgroups.
        See Also:
        isMemberOf(PrincipalGroup)
      • setGroups

        public void setGroups​(SessionContext ctx,
                              java.util.Set groups)
        Sets the users memberships in the given groups.
        Overrides:
        setGroups in class GeneratedPrincipal
        Parameters:
        groups - - the groups the user should be member in
      • getAllSearchRestrictions

        public java.util.Collection<SearchRestriction> getAllSearchRestrictions()
        Gets all search restrictions of this principal.
        Returns:
        all search restrictions of this principal
      • getAllSearchRestrictions

        public java.util.Collection<SearchRestriction> getAllSearchRestrictions​(SessionContext ctx)
        Gets all search restrictions of this principal.
        Returns:
        all search restrictions of this principal
      • getItemPermissionsMap

        public java.util.Map getItemPermissionsMap​(java.util.List userRights)
        Returns all stored permissions for this principal and a given list of user rights.

        The result map contains all items which this principal owns stored permissions for as keys, and a list of Boolean objects ordered according to the given user rights list. These objects have the following meaning:

        • Boolean.TRUE ... a negative permission is stored
        • Boolean.FALSE ... a positive permission is stored
        • null ... no permission is stored for the according user right
        Please note that this method is considerably costly since it always requires querying the database. A alternative access to permission is provided via Item.getPermissionMap(List).
        Since:
        2.10
      • setItemPermissionsByMap

        public void setItemPermissionsByMap​(java.util.List userRights,
                                            java.util.Map permissionMap)
        Changes all stored permissions for this principal and a given list of user rights at once.

        The argument map must contain all items which this principal owns stored permissions for as keys, and a list of Boolean objects ordered according to the given user rights list. These objects have the following meaning:

        • Boolean.TRUE ... a negative permission is stored
        • Boolean.FALSE ... a positive permission is stored
        • null ... no permission is stored for the according user right
        Please note that this method is quite costly since it always requires querying the database. A alternative access to permissions is provided via Item.setPermissionsByMap(List, Map).
        Since:
        2.10
      • getGlobalPositivePermissions

        public java.util.Set getGlobalPositivePermissions()
        Gets all positive permissions of this principal.
      • getGlobalNegativePermissions

        public java.util.Set getGlobalNegativePermissions()
        Gets all negative permissions of this principal.
      • getAllGlobalPositivePermissions

        public java.util.Collection getAllGlobalPositivePermissions()
        Gets all positive permissions of this principal including all positive permissions of groups the principal is member of.
      • getAllGlobalNegativePermissions

        public java.util.Collection getAllGlobalNegativePermissions()
        Gets all negative permissions of this principal including all negative permissions of groups the principal is member of.
      • isAdmin

        public abstract boolean isAdmin()
        Checks whether the Principal is the admin user.
      • checkOwnGlobalPermission

        @Deprecated
        public int checkOwnGlobalPermission​(PK userRightPK)
        Deprecated.
        since ages - use (PrincipalModel, String)
      • remove

        public void remove​(SessionContext ctx)
                    throws ConsistencyCheckException
        SLDSafe - previously there was an intentional bug that deleted all the addresses after User was deleted - even those that are duplicates with the original field set. Now addresses is a relation not an attribute and partOf takes care of deleting them.
        Overrides:
        remove in class Item
        Parameters:
        ctx - A SessionContext object
        Throws:
        ConsistencyCheckException
      • getDisplayName

        @Deprecated
        public abstract java.lang.String getDisplayName​(SessionContext ctx)
        Deprecated.
        since ages - usePrincipalModel.getDisplayName() Old jalo generated method from GeneratedPrincipal - Getter of the Principal.displayName jalo localized attribute.
        Returns:
        the displayName
      • getDisplayName

        @Deprecated
        public java.lang.String getDisplayName()
        Deprecated.
        since ages - usePrincipalModel.getDisplayName() Old jalo generated method from GeneratedPrincipal - Getter of the Principal.displayName jalo localized attribute.
        Returns:
        the displayName
      • getAllDisplayName

        @Deprecated
        public abstract java.util.Map<Language,​java.lang.String> getAllDisplayName​(SessionContext ctx)
        Deprecated.
        since ages
        Old jalo generated method from GeneratedPrincipal - Getter of the Principal.displayName jalo localized attribute.
        Returns:
        the localized displayName
      • getAllDisplayName

        @Deprecated
        public java.util.Map<Language,​java.lang.String> getAllDisplayName()
        Deprecated.
        since ages
        Old jalo generated method from GeneratedPrincipal - Getter of the Principal.displayName jalo localized attribute.
        Returns:
        the localized displayName