Skip to content

Commit

Permalink
Spread one-liner across multiple lines
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Jul 3, 2024
1 parent e2b1fcd commit a95f34f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/LexBoxApi/GraphQL/LexQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ public IQueryable<Organization> MyOrgs(LexBoxDbContext context, LoggedInContext
// Site admins and org admins can see everything
if (permissionService.CanEditOrg(orgId)) return org;
// Non-admins cannot see email addresses or usernames
org.Members?.ForEach(m => { if (m.User is not null) { m.User.Email = null; m.User.Username = null; } });
org.Members?.ForEach(m =>
{
if (m.User is not null)
{
m.User.Email = null;
m.User.Username = null;
}
});
// Members and non-members alike can see all public projects plus their own
org.Projects = org.Projects?.Where(p => p.IsConfidential == false || permissionService.CanSyncProject(p.Id))?.ToList() ?? [];
if (!permissionService.IsOrgMember(orgId))
Expand Down

0 comments on commit a95f34f

Please sign in to comment.