mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
Return collection with highest permission levels
This commit is contained in:
parent
2419bc2928
commit
06e0f3b73e
@ -107,7 +107,21 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
// Return distinct Id results.
|
||||
return results
|
||||
.GroupBy(c => c.Id)
|
||||
.Select(c => c.First())
|
||||
.Select(grouping =>
|
||||
{
|
||||
var first = grouping.First();
|
||||
if (first.HidePasswords)
|
||||
{
|
||||
first.HidePasswords = !grouping.Any(c => !c.HidePasswords);
|
||||
}
|
||||
|
||||
if (first.ReadOnly)
|
||||
{
|
||||
first.ReadOnly = !grouping.Any(c => !c.ReadOnly);
|
||||
}
|
||||
|
||||
return first;
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user