@Override protected void prepareModel() throws Exception { if (id != null) { entity = accountManager.getRole(id); } else { entity = new Role(); } }
@Override public String save() throws Exception { // 根据页面上的checkbox 整合Role的Authorities Set. HibernateUtils.mergeByCheckedIds(entity.getAuthorityList(), checkedAuthIds, Authority.class); // 保存用户并放入成功信息. accountManager.saveRole(entity); addActionMessage("保存角色成功"); return RELOAD; }
/** input页面显示所有授权列表. */ public List<Authority> getAllAuthorityList() { return accountManager.getAllAuthority(); }
@Override public String delete() throws Exception { accountManager.deleteRole(id); addActionMessage("删除角色成功"); return RELOAD; }
// -- CRUD Action 函数 --// @Override public String list() throws Exception { allRoleList = accountManager.getAllRole(); return SUCCESS; }