Class MUser

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_AD_User, I_Persistent, Evaluatee, ImmutablePOSupport

public class MUser extends X_AD_User implements ImmutablePOSupport
User Model
Version:
$Id: MUser.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, www.arhipac.ro
  • FR [ 2788430 ] MUser.getOfBPartner add trxName parameter https://sourceforge.net/p/adempiere/feature-requests/714/
  • See Also:
    • Constructor Details

      • MUser

        public MUser(Properties ctx, String AD_User_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        AD_User_UU - UUID key
        trxName - Transaction
      • MUser

        public MUser(Properties ctx, int AD_User_ID, String trxName)
        Default Constructor
        Parameters:
        ctx - context
        AD_User_ID - id
        trxName - transaction
      • MUser

        public MUser(X_C_BPartner partner)
        Parent Constructor
        Parameters:
        partner - partner
      • MUser

        public MUser(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - current row of result set to be loaded
        trxName - transaction
      • MUser

        public MUser(MUser copy)
        Parameters:
        copy -
      • MUser

        public MUser(Properties ctx, MUser copy)
        Parameters:
        ctx -
        copy -
      • MUser

        public MUser(Properties ctx, MUser copy, String trxName)
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • getOfBPartner

        public static MUser[] getOfBPartner(Properties ctx, int C_BPartner_ID)
        Deprecated.
        Since 3.5.3a. Please use getOfBPartner(Properties, int, String).
        Get active Users of BPartner
        Parameters:
        ctx - context
        C_BPartner_ID - id
        Returns:
        array of users
      • getOfBPartner

        public static MUser[] getOfBPartner(Properties ctx, int C_BPartner_ID, String trxName)
        Get active Users of BPartner
        Parameters:
        ctx -
        C_BPartner_ID -
        trxName -
        Returns:
        array of users
      • getWithRole

        public static MUser[] getWithRole(MRole role)
        Get Users with Role
        Parameters:
        role - role
        Returns:
        array of users
      • get

        public static MUser get(int AD_User_ID)
        Get User (cached) (immutable) Also loads Admninistrator (0)
        Parameters:
        AD_User_ID - id
        Returns:
        user
      • get

        public static MUser get(Properties ctx, int AD_User_ID)
        Get User (cached) (immutable) Also loads Admninistrator (0)
        Parameters:
        ctx - context
        AD_User_ID - id
        Returns:
        user
      • get

        public static MUser get(Properties ctx)
        Get Current User (cached)
        Parameters:
        ctx - context
        Returns:
        user
      • getCopy

        public static MUser getCopy(Properties ctx, int AD_User_ID, String trxName)
        Get updateable copy of MUser from cache
        Parameters:
        ctx -
        AD_User_ID -
        trxName -
        Returns:
        MUser
      • get

        public static MUser get(Properties ctx, String name, String password)
      • get

        public static MUser get(Properties ctx, String name, String password, boolean isSSOLogin)
        Get User
        Parameters:
        ctx - context
        name - name
        password - password
        isSSOLogin - when isSSOLogin is true, password is ignored.
        Returns:
        user or null
      • getNameOfUser

        public static String getNameOfUser(int AD_User_ID)
        Get Name of AD_User
        Parameters:
        AD_User_ID - System User
        Returns:
        Name of user or ?
      • isSalesRep

        public static boolean isSalesRep(int AD_User_ID)
        User is SalesRep
        Parameters:
        AD_User_ID - user
        Returns:
        true if sales rep
      • getValue

        public String getValue()
        Get Value - 7 bit lower case alpha numerics max length 8
        Specified by:
        getValue in interface I_AD_User
        Overrides:
        getValue in class X_AD_User
        Returns:
        value
      • setValue

        public void setValue(String Value)
        Set Value - 7 bit lower case alpha numerics max length 8
        Specified by:
        setValue in interface I_AD_User
        Overrides:
        setValue in class X_AD_User
        Parameters:
        Value -
      • setPassword

        public void setPassword(String password)
        Convert Password to SHA-512 hash with salt * 1000 iterations https://www.owasp.org/index.php/Hashing_Java
        Specified by:
        setPassword in interface I_AD_User
        Overrides:
        setPassword in class X_AD_User
        Parameters:
        password - -- plain text password
      • authenticateHash

        public boolean authenticateHash(String password)
        check if hashed password matches
      • getFirstName

        public String getFirstName()
        Get First Name
        Returns:
        first name
      • getLastName

        public String getLastName()
        Get Last Name
        Returns:
        first name
      • addDescription

        public void addDescription(String description)
        Add to Description
        Parameters:
        description - description to be added
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_AD_User
        Returns:
        Info
      • isOnline

        public boolean isOnline()
        Is it an Online Access User
        Returns:
        true if it has an email and password
      • setEMail

        public void setEMail(String EMail)
        Set EMail - reset validation
        Specified by:
        setEMail in interface I_AD_User
        Overrides:
        setEMail in class X_AD_User
        Parameters:
        EMail - email
      • getInternetAddress

        public javax.mail.internet.InternetAddress getInternetAddress()
        Convert EMail
        Returns:
        Valid Internet Address
      • isEMailValid

        public boolean isEMailValid()
        Is the email valid
        Returns:
        return true if email is valid (artificial check)
      • isCanSendEMail

        public boolean isCanSendEMail()
        Could we send an email
        Returns:
        true if EMail Uwer/PW exists
      • getEMailVerifyCode

        public String getEMailVerifyCode()
        Get EMail Validation Code
        Returns:
        code
      • setEMailVerifyCode

        public boolean setEMailVerifyCode(String code, String info)
        Check and Set EMail Validation Code.
        Parameters:
        code - code
        info - info
        Returns:
        true if valid
      • isEMailVerified

        public boolean isEMailVerified()
        Is EMail Verified by response
        Returns:
        true if verified
      • isNotificationEMail

        public boolean isNotificationEMail()
        Get Notification via EMail
        Returns:
        true if email
      • isNotificationNote

        public boolean isNotificationNote()
        Get Notification via Note
        Returns:
        true if note
      • getRoles

        public MRole[] getRoles(int AD_Org_ID)
        Get User Roles for Org
        Parameters:
        AD_Org_ID - org
        Returns:
        array of roles
      • isAdministrator

        public boolean isAdministrator()
        Is User an Administrator?
        Returns:
        true if Admin
      • hasURLFormAccess

        public boolean hasURLFormAccess(String url)
        User has access to URL form?
        Returns:
        true if user has access
      • hasBPAccess

        public boolean hasBPAccess(String BPAccessType, Object[] params)
        Has the user Access to BP info and resources
        Parameters:
        BPAccessType - access type
        params - opt parameter
        Returns:
        true if access
      • getBPAccess

        public MUserBPAccess[] getBPAccess(boolean requery)
        Get active BP Access records
        Parameters:
        requery - requery
        Returns:
        access list
      • beforeSave

        protected boolean beforeSave(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        true
      • isMenuAutoExpand

        public boolean isMenuAutoExpand()
        Is Menu Auto Expand - user preference Check if the user has a preference, otherwise use the value from current role
        Returns:
        boolean
      • get

        public static MUser get(Properties ctx, String name)
        Get User that has roles (already authenticated)
        Parameters:
        ctx - context
        name - name
        Returns:
        user or null
      • getEMailUser

        public String getEMailUser()
        Description copied from class: X_AD_User
        Get EMail User ID.
        Specified by:
        getEMailUser in interface I_AD_User
        Overrides:
        getEMailUser in class X_AD_User
        Returns:
        User Name (ID) in the Mail System
      • getEMailUserPW

        public String getEMailUserPW()
        Description copied from class: X_AD_User
        Get EMail User Password.
        Specified by:
        getEMailUserPW in interface I_AD_User
        Overrides:
        getEMailUserPW in class X_AD_User
        Returns:
        Password of your email user id
      • afterSave

        protected boolean afterSave(boolean newRecord, boolean success)
        save new pass to history
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new record
        success - true if save operation was success
        Returns:
        if save was a success
      • postDelete

        protected boolean postDelete()
        Description copied from class: PO
        Executed after the Delete operation is committed in the database.
        Overrides:
        postDelete in class PO
        Returns:
        true if post delete is a success
      • markImmutable

        public MUser markImmutable()
        Description copied from interface: ImmutablePOSupport
        mark PO as immutable
        Specified by:
        markImmutable in interface ImmutablePOSupport
        Returns:
        PO