private void bindRoleActions(ISecurity f) { IBlock sblock = getBlock("sysroles"); SecurityTool tool = SecurityHelper.GetSecurityTool(f, ctx); IList actionList = tool.GetActionAll(); bindList("actions", "a", actionList); IList allRoles = tool.GetRoles(); String lastRoleType = null; foreach (IRole role in allRoles) { sblock.Set("role.Name", role.Name); bindCheckBoxList(tool, sblock, role); if (role.Role.GetType().FullName.Equals(lastRoleType) == false) { sblock.Set("seperator", "<tr><td colspan=" + (actionList.Count + 1) + "> </td></tr>"); lastRoleType = role.Role.GetType().FullName; } else { sblock.Set("seperator", ""); } sblock.Next(); } }
//--------------------------------------------------------- public void PermissionAdmin() { target(SavePermissionAdminAll); SecurityTool tool = getSecurityTool(); IList sysRoles = tool.GetRoles(); bindRoleActions(sysRoles, tool); }