diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs index 00083472d8..fa84b3c651 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs @@ -45,8 +45,7 @@ public class UserCollectionDetailsQuery : IQuery o.Enabled && (ou.AccessAll || cu.CollectionId != null || g.AccessAll || cg.CollectionId != null) select new { c, ou, o, cu, gu, g, cg }; -#pragma warning disable IDE0075 - // I want to leave the ReadOnly and HidePasswords the way they are because it helps show the exact logic we are trying to replicate + return query.Select(x => new CollectionDetails { Id = x.c.Id, @@ -55,11 +54,10 @@ public class UserCollectionDetailsQuery : IQuery ExternalId = x.c.ExternalId, CreationDate = x.c.CreationDate, RevisionDate = x.c.RevisionDate, - ReadOnly = x.ou.AccessAll || x.g.AccessAll || ((x.cu != null ? x.cu.ReadOnly : (bool?)null) ?? (x.cg != null ? x.cg.ReadOnly : (bool?)null) ?? false) ? false : true, - HidePasswords = x.ou.AccessAll || x.g.AccessAll || ((x.cu != null ? x.cu.HidePasswords : (bool?)null) ?? (x.cg != null ? x.cg.HidePasswords : (bool?)null) ?? false) ? false : true, + ReadOnly = x.ou.AccessAll || x.g.AccessAll || + !((bool?)x.cu.ReadOnly ?? (bool?)x.cg.ReadOnly ?? false) ? false : true, + HidePasswords = x.ou.AccessAll || x.g.AccessAll || + !((bool?)x.cu.HidePasswords ?? (bool?)x.cg.HidePasswords ?? false) ? false : true, }); -#pragma warning restore IDE0075 } - - }