if (null == user) {
return redirect("admin", "info.save.failure");
} else {
if (authorityService.getUserService().isAdmin(user)) { return redirect("admin",
"info.save.failure"); }
AdminUser adminUser = new AdminUserBean();
adminUser.setUser(user);
adminUser.setCreatedAt(new Date());
adminUser.setUpdatedAt(new Date());
entityDao.saveOrUpdate(adminUser);
return redirect("admin", "info.save.success");
}
}
Long adminId = getLong("removeAdminId");
if (null != adminId) {
AdminUser adminUser = entityDao.get(AdminUser.class, adminId);
if (null != adminUser) {
entityDao.remove(adminUser);
}
return redirect("admin", "info.remove.success");
}