Skip to content

Commit c13018f

Browse files
committed
fix: privacy filter
1 parent 5c0188b commit c13018f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

HwProj.APIGateway/HwProj.APIGateway.API/Filters/FilesPrivacyFilter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ public async Task<bool> CheckDownloadRights(string? userId, ScopeDTO fileScope)
2929
var solution = await _solutionsServiceClient.GetSolutionById(fileScope.CourseUnitId);
3030
studentIds.Add(solution.StudentId);
3131
var groupIds = await _coursesServiceClient.GetGroupsById(solution.GroupId ?? 0);
32+
studentIds.UnionWith(groupIds.FirstOrDefault()?.StudentsIds.ToHashSet() ?? new());
3233

3334
var mentorIds = await _coursesServiceClient.GetCourseLecturersIds(fileScope.CourseId);
34-
if (!mentorIds.Contains(userId)) return false;
35-
studentIds.UnionWith(groupIds.FirstOrDefault()?.StudentsIds.ToHashSet() ?? new());
3635

3736
if (!studentIds.Contains(userId) && !mentorIds.Contains(userId)) return false;
3837

0 commit comments

Comments
 (0)