/// <summary> /// Gets a list of accessible message areas groups for an user /// </summary> /// <param name="username">user to check</param> /// <returns></returns> public IQueryable <MessageAreasGroup> GetAllowedMessageAreasGroup(string username) => MessageAreasGroups.Where( g => g.AllowedGroupId == null || UsersGroupsLinks.Where(u => u.Userid == username).Select(ug => ug.Groupid).Contains(g.AllowedGroupId));
/// <summary> /// Gets a list of accessible message areas for an user /// </summary> /// <param name="group"></param> /// <param name="username"></param> /// <returns></returns> public IQueryable <MessageArea> GetMessageAllowedAreasByGroup(string group, string username) => string.IsNullOrWhiteSpace(group) ? MessageAreas : MessageAreas.Where(a => a.Areagroup == group.ToUpper()).Where( g => g.AllowedGroupRead == null || UsersGroupsLinks.Where(u => u.Userid == username).Select(ug => ug.Groupid).Contains(g.AllowedGroupRead));