mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Handle Constant Expression Warning (#4613)
* Add Collections Tests * Update CollectionRepository Implementation * Test Adding And Deleting Through Replace * Format * Fix Most Test Warnings * Format * Handle Constant Expression Warning * Revert AccountRevisionDate Changes * Revert RevisionData Changes More Exactly
This commit is contained in:
parent
8e9d130574
commit
0e95f6752d
@ -68,8 +68,8 @@ public static class DatabaseContextExtensions
|
||||
from cg in cg_g.DefaultIfEmpty()
|
||||
where ou.OrganizationId == organizationId &&
|
||||
ou.Status == OrganizationUserStatusType.Confirmed &&
|
||||
(cu.CollectionId != null ||
|
||||
cg.CollectionId != null)
|
||||
((cu == null ? (Guid?)null : cu.CollectionId) != null ||
|
||||
(cg == null ? (Guid?)null : cg.CollectionId) != null)
|
||||
select u;
|
||||
|
||||
var users = await query.ToListAsync();
|
||||
@ -99,8 +99,8 @@ public static class DatabaseContextExtensions
|
||||
from cg in cg_g.DefaultIfEmpty()
|
||||
where ou.OrganizationId == organizationId && collectionIds.Contains(c.Id) &&
|
||||
ou.Status == OrganizationUserStatusType.Confirmed &&
|
||||
(cu.CollectionId != null ||
|
||||
cg.CollectionId != null)
|
||||
((cu == null ? (Guid?)null : cu.CollectionId) != null ||
|
||||
(cg == null ? (Guid?)null : cg.CollectionId) != null)
|
||||
select u;
|
||||
|
||||
var users = await query.ToListAsync();
|
||||
|
@ -43,7 +43,7 @@ public class CollectionCipherReadByUserIdQuery : IQuery<CollectionCipher>
|
||||
from cg in cg_g.DefaultIfEmpty()
|
||||
|
||||
where ou.Status == OrganizationUserStatusType.Confirmed &&
|
||||
(cu.CollectionId != null || cg.CollectionId != null)
|
||||
((cu == null ? (Guid?)null : cu.CollectionId) != null || (cg == null ? (Guid?)null : cg.CollectionId) != null)
|
||||
select cc;
|
||||
return query;
|
||||
}
|
||||
|
@ -46,8 +46,8 @@ public class UserBumpAccountRevisionDateByCipherIdQuery : IQuery<User>
|
||||
|
||||
where ou.OrganizationId == _organizationId &&
|
||||
ou.Status == OrganizationUserStatusType.Confirmed &&
|
||||
(cu.CollectionId != null ||
|
||||
cg.CollectionId != null)
|
||||
((cu == null ? (Guid?)null : cu.CollectionId) != null ||
|
||||
(cg == null ? (Guid?)null : cg.CollectionId) != null)
|
||||
select u;
|
||||
return query;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class UserCipherDetailsQuery : IQuery<CipherDetails>
|
||||
new { cg.CollectionId, cg.GroupId } into cg_g
|
||||
from cg in cg_g.DefaultIfEmpty()
|
||||
|
||||
where cu.CollectionId != null || cg.CollectionId != null
|
||||
where (cu == null ? (Guid?)null : cu.CollectionId) != null || (cg == null ? (Guid?)null : cg.CollectionId) != null
|
||||
|
||||
select c;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class UserCollectionDetailsQuery : IQuery<CollectionDetails>
|
||||
where ou.UserId == _userId &&
|
||||
ou.Status == OrganizationUserStatusType.Confirmed &&
|
||||
o.Enabled &&
|
||||
(cu.CollectionId != null || cg.CollectionId != null)
|
||||
((cu == null ? (Guid?)null : cu.CollectionId) != null || (cg == null ? (Guid?)null : cg.CollectionId) != null)
|
||||
select new { c, ou, o, cu, gu, g, cg };
|
||||
|
||||
return query.Select(x => new CollectionDetails
|
||||
|
@ -60,7 +60,7 @@ public class CipherReadCanEditByIdUserIdQuery : IQuery<Cipher>
|
||||
c.UserId == _userId ||
|
||||
(
|
||||
!c.UserId.HasValue && ou.Status == OrganizationUserStatusType.Confirmed && o.Enabled &&
|
||||
(cu.CollectionId != null || cg.CollectionId != null)
|
||||
((cu == null ? (Guid?)null : cu.CollectionId) != null || (cg == null ? (Guid?)null : cg.CollectionId) != null)
|
||||
)
|
||||
) &&
|
||||
(c.UserId.HasValue || !cu.ReadOnly || !cg.ReadOnly)
|
||||
|
Loading…
Reference in New Issue
Block a user