feat(learning): harden access and practice sessions
This commit is contained in:
@@ -19,6 +19,9 @@ public sealed class StudyContentQueryService(IContentAssetPersistence dbContext)
|
||||
.Where(unit =>
|
||||
unit.TenantId == filter.TenantId &&
|
||||
unit.IsActive);
|
||||
if (filter.AllowedRegionIds is not null)
|
||||
query = query.Where(unit => unit.RegionId == null ||
|
||||
filter.AllowedRegionIds.Contains(unit.RegionId.Value));
|
||||
|
||||
if (filter.RegionId.HasValue)
|
||||
query = query.Where(unit => unit.RegionId == filter.RegionId.Value || unit.RegionId == null);
|
||||
@@ -108,6 +111,9 @@ public sealed class StudyContentQueryService(IContentAssetPersistence dbContext)
|
||||
.Where(subject =>
|
||||
subject.TenantId == filter.TenantId &&
|
||||
subject.IsActive);
|
||||
if (filter.AllowedRegionIds is not null)
|
||||
query = query.Where(subject => subject.RegionId == null ||
|
||||
filter.AllowedRegionIds.Contains(subject.RegionId.Value));
|
||||
|
||||
if (filter.RegionId.HasValue)
|
||||
query = query.Where(subject => subject.RegionId == filter.RegionId.Value || subject.RegionId == null);
|
||||
@@ -240,4 +246,4 @@ public sealed class StudyContentQueryService(IContentAssetPersistence dbContext)
|
||||
{
|
||||
return Math.Clamp(limit ?? DefaultLimit, 1, MaxLimit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user