mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +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 distinct Id results.
|
||||||
return results
|
return results
|
||||||
.GroupBy(c => c.Id)
|
.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();
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user