use of org.simbasecurity.core.service.communication.reset.password.NewUser in project simba-os by cegeka.
the class UserFactory method createRestUser.
public String createRestUser(String username) {
UserEntity temporaryUser = UserEntity.restUser(username, Language.nl_NL);
User newUser = createRestUser(temporaryUser);
User attachedUser = userRepository.persist(newUser);
String password = passwordGenerator.generatePassword();
attachedUser.changePassword(password, password);
managementAudit.log("REST User ''{0}'' created", username);
return password;
}
use of org.simbasecurity.core.service.communication.reset.password.NewUser in project simba-os by cegeka.
the class UserFactory method create.
public User create(User user) {
User newUser = createUser(user);
managementAudit.log("User ''{0}'' created", user.getUserName());
return newUser;
}
use of org.simbasecurity.core.service.communication.reset.password.NewUser in project simba-os by cegeka.
the class UserFactory method createWithRoles.
public User createWithRoles(User user, List<String> roleNames) {
User newUser = createUser(user);
roleNames.stream().map(n -> roleRepository.findByName(n)).filter(Objects::nonNull).forEach(newUser::addRole);
managementAudit.log("User ''{0}'' created with roles ''{1}''", newUser.getUserName(), join(roleNames, r -> r));
return newUser;
}
use of org.simbasecurity.core.service.communication.reset.password.NewUser in project simba-os by cegeka.
the class UserFactory method createEIDUserWithRoles.
public User createEIDUserWithRoles(User user, List<String> roleNames) {
validateUniqueUsername(user);
User newUser = userRepository.persist(user);
roleNames.stream().map(n -> roleRepository.findByName(n)).filter(Objects::nonNull).forEach(newUser::addRole);
managementAudit.log("User ''{0}'' created with roles ''{1}''", newUser.getUserName(), join(roleNames, r -> r));
return newUser;
}
use of org.simbasecurity.core.service.communication.reset.password.NewUser in project simba-os by cegeka.
the class UserFactory method cloneUser.
public User cloneUser(User user, String clonedUsername) {
User newUser = createUser(user);
newUser.addRoles(userRepository.findByName(clonedUsername).getRoles());
managementAudit.log("User ''{0}'' created as clone of ''{1}''", newUser.getUserName(), clonedUsername);
return newUser;
}
Aggregations