Package org.codehaus.plexus.redback.policy

Examples of org.codehaus.plexus.redback.policy.UserSecurityPolicy


    private void createUser( String username, String fullname, String email, String password, boolean locked,
                             boolean validated )
    {
        UserManager userManager = securitySystem.getUserManager();
        UserSecurityPolicy policy = securitySystem.getPolicy();

        User user;

        try
        {
            user = userManager.findUser( username );
        }
        catch ( UserNotFoundException e )
        {
            policy.setEnabled( false );
            user = userManager.createUser( username, fullname, email );
            user.setPassword( password );
            user.setLocked( locked );
            user.setValidated( validated );
            user = userManager.addUser( user );
        }
        finally
        {
            policy.setEnabled( true );
        }

        try
        {
            roleManager.assignRole( "registered-user", user.getPrincipal().toString() );    
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.redback.policy.UserSecurityPolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.