From b5050b75b1a7f2c82559ba3e89573b820f41716f Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Thu, 31 Oct 2024 14:09:15 +0100 Subject: [PATCH] Make ProjectMembersVisibilityMiddleware more robust --- .../GraphQL/CustomTypes/ProjectMembersVisibilityMiddleware.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/LexBoxApi/GraphQL/CustomTypes/ProjectMembersVisibilityMiddleware.cs b/backend/LexBoxApi/GraphQL/CustomTypes/ProjectMembersVisibilityMiddleware.cs index 2ce468a93..026b01fc0 100644 --- a/backend/LexBoxApi/GraphQL/CustomTypes/ProjectMembersVisibilityMiddleware.cs +++ b/backend/LexBoxApi/GraphQL/CustomTypes/ProjectMembersVisibilityMiddleware.cs @@ -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(); } } }