Search in sources :

Example 1 with Password

use of org.apache.isis.applib.value.Password in project estatio by estatio.

the class ApplicationUserBuilder method execute.

@Override
protected void execute(ExecutionContext executionContext) {
    checkParam("person", executionContext, Person.class);
    checkParam("securityUsername", executionContext, String.class);
    defaultParam("securityUserAccountCloneFrom", executionContext, "estatio-admin");
    if (securityUsername != null) {
        ApplicationUser userToCloneFrom = applicationUserRepository.findByUsername(securityUserAccountCloneFrom);
        if (userToCloneFrom == null) {
            throw new IllegalArgumentException("Could not find any user with username: " + securityUserAccountCloneFrom);
        }
        object = applicationUserRepository.newLocalUserBasedOn(securityUsername, new Password("pass"), new Password("pass"), userToCloneFrom, true, null);
        object.setAtPath(person.getAtPath());
        person.setUsername(securityUsername);
        executionContext.addResult(this, securityUsername, userToCloneFrom);
    }
}
Also used : ApplicationUser(org.isisaddons.module.security.dom.user.ApplicationUser) Password(org.apache.isis.applib.value.Password)

Aggregations

Password (org.apache.isis.applib.value.Password)1 ApplicationUser (org.isisaddons.module.security.dom.user.ApplicationUser)1