private void createUser(String fn, String mn, String ln, String addr, String pn, String eaddr,
String roleKey,
List<String> privKeys,
List<String> actionKeys) {
SeteUser user = new SeteUser();
user.setFirstName(fn);
user.setMiddleName(mn);
user.setLastName(ln);
user.setDateOfBirth(new Date());
user.setLoginName(fn);
user.setPassword(passwordEncoder.encodePassword("sete", null));
ContactInformation ci = new ContactInformation();
ci.setAddress(addr);
ci.setEmailAddress(eaddr);
ci.setPhoneNumber(pn);
user.setContactInformation(ci);
Set<UserRolePrivilege> rolePrivs = new HashSet<UserRolePrivilege>();
UserRolePrivilege p = new UserRolePrivilege();
p.setUserRoleType(TypeUtil.forKey(UserRoleType.class, roleKey));
Set<UserPrivilege> privs = new HashSet<UserPrivilege>();
UserPrivilege up = null;
for(String pk : privKeys) {
up = new UserPrivilege();
up.setUserPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, pk));
for(String ak : actionKeys) {
up.setPrivilegeActionType(TypeUtil.forKey(PrivilegeActionType.class, ak));
}
privs.add(up);
}
p.setUserPrivileges(privs);
rolePrivs.add(p);
user.setUserRolePrivileges(rolePrivs);
baseDao.saveOrUpdate(user);
}