1
0
mirror of https://github.com/bitwarden/server synced 2025-12-27 21:53:24 +00:00

[PM-22503] Fix manage cipher permission (#5972)

* Added new tests to validate that the ciphers are being grouped and filtered correctly when assigned to multiple collections and changing order of grouping properties.
This commit is contained in:
Jared McCannon
2025-06-23 12:11:32 -04:00
committed by GitHub
parent cdfe51f9d6
commit d2410747d0
3 changed files with 72 additions and 3 deletions

View File

@@ -98,7 +98,10 @@ public class CipherRepository : Repository<Cipher, Guid>, ICipherRepository
return results
.GroupBy(c => c.Id)
.Select(g => g.OrderByDescending(og => og.Edit).ThenByDescending(og => og.ViewPassword).First())
.Select(g =>
g.OrderByDescending(og => og.Manage)
.ThenByDescending(og => og.Edit)
.ThenByDescending(og => og.ViewPassword).First())
.ToList();
}
}