Role role = roleDao.getRole("admin");
if (role == null) {
log.info("admin role not found...");
role = new Role();
role.setName("admin");
role.addPermission(new Permission(AUTH_USER, "*", true));
role.addPermission(new Permission(AUTH_USER_EDIT, "", false));
role.addPermission(new Permission(AUTH_ROLE_EDIT, "", false));
role.addPermission(new Permission(AUTH_FUNCTION_LOG, "", false));
role.addPermission(new Permission(AUTH_CURRENT_USERS, "", false));
role.addPermission(new Permission(AUTH_USER_CHANGE_PWD, "", false));
log.info("creating admin role...");
roleDao.makePersistent(role);
}
admin.addRole(role);