public static List <Sys_Permission> GetList(int userId) { //a.根据用户ID查询角色ID集合 (一对多关系) var listRoleIds = UserRoleRelationAccess.GetList(userId).Select(c => c.SURRRoleId).ToList(); //b.根据角色ID查询权限ID集合 (多对多关系) var listModuleIds = RoleAuthorizeAccess.GetList().Where(c => listRoleIds.Contains(c.SRARoleId)).Select(c => c.SRAModuleId).ToList(); //c.根据权限ID集合查询所有权限实体。 return(PermissionAccess.GetList().Where(c => listModuleIds.Contains(c.Id) && c.SPIsEnabled == 1).ToList()); }
public static Page <Sys_Permission> GetList(int pageIndex, int pageSize, string keyWord) { return(PermissionAccess.GetList(pageIndex, pageSize, keyWord)); }
public static List <Sys_Permission> GetList() { return(PermissionAccess.GetList()); }