Class User

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable
    Direct Known Subclasses:
    GeneratedCustomer, GeneratedEmployee, MyTestUser

    public class User
    extends GeneratedUser
    Superclass of all hybris platform user types.

    A user always is identified by a login - password - pair, owns a name and an affiliate id , may belong to user groups.

    As a subclass of principal each user can be assigned permissions. Additionally permissions can be assigned to user groups which makes user right management easier.

       If you like to login a user you have to different ways. The first one is to transfer the session, the second one is to create a new session for the user. The example assumes you are working in a jsp.
     <code>
     String login   = request.getParameter( "login" );
                                                                                                                                            String  passwd  = request.getParameter( "password" );     //you may encrypt the password by using ssl. However the password will be delivered in plain text. Properties props = new Properties(); //a HashMap is fine as well prop.put( JaloSession.LoginProperties.LOGIN, login ); prop.put( JaloSession.LoginProperties.PASSWORD, passwd ); prop.put( JaloSession.LoginProperties.SESSION_TYPE, JaloSession.LoginProperties.SessionTypes.CUSTOMER ); getJaloSession().getConnection().transferSession( getJaloSession(), prop ); // transfer the current session to the given user. getJaloSession().getConnection().createSession(prop); //creates a new session for the given user.
     </code>
     
    See Also:
    Serialized Form