Calendar calendar = expirationDate();
Password password = new Password(DEFAULT_PASSWORD.toCharArray());
identityManager.updateCredential(developerUser, password, new Date(), calendar.getTime());
Role roleDeveloper = new Role(UserRoles.DEVELOPER);
identityManager.add(roleDeveloper);
grantRoles(developerUser, roleDeveloper);
}
//Temp hack to add user with admin rights
User adminUser = BasicModel.getUser(identityManager, DEFAULT_ADMIN);
// We only create the Admin user, if there is none;
// if present, there is also no need to apply the same 'Admin' user again.
if (adminUser == null) {
adminUser = new User(DEFAULT_ADMIN);
identityManager.add(adminUser);
Calendar calendar = expirationDate();
Password password = new Password(DEFAULT_PASSWORD.toCharArray());
identityManager.updateCredential(adminUser, password, new Date(), calendar.getTime());
Role roleAdmin = new Role(UserRoles.ADMIN);
identityManager.add(roleAdmin);
grantRoles(adminUser, roleAdmin);
}