Skip to content

Commit

Permalink
Make ProjectMembersVisibilityMiddleware more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Oct 31, 2024
1 parent e83930d commit b5050b7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public async Task InvokeAsync(IMiddlewareContext context, IPermissionService per
if (!await permissionService.CanViewProjectMembers(projId))
{
// Confidential project, and user doesn't have permission to see its users, so only show the current user's membership
context.Result = projectUsers.Where(pu => pu.User?.Id == loggedInContext.MaybeUser?.Id).ToList();
context.Result = projectUsers.Where(pu =>
pu.User?.Id == loggedInContext.MaybeUser?.Id ||
pu.UserId == loggedInContext.MaybeUser?.Id).ToList();
}
}
}
Expand Down

0 comments on commit b5050b7

Please sign in to comment.