use of cern.laser.business.definition.LaserDefinitionDuplicationException in project ACS by ACS-Community.
the class AdminUserDefinitionServiceImpl method createAdminUser.
public String createAdminUser(String name, String password) throws LaserDefinitionException {
LOGGER.info("creating admin user : " + name + "/" + password);
AdminUser admin_user = adminUserDAO.getAdminUserByName(name);
if (admin_user != null) {
throw new LaserDefinitionDuplicationException("a user " + name + " already exists");
}
admin_user = new AdminUser(name, password);
admin_user.addAdministeredCategory(categoryDAO.findByCategoryTreeRoot());
adminUserDAO.saveAdminUser(admin_user);
LOGGER.info("admin user " + name + "/" + password + " created");
return admin_user.getUserId();
}
Aggregations