mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-14 13:42:42 +00:00
optimize condition check
This commit is contained in:
parent
67732fe5a1
commit
a477a6f242
1 changed files with 7 additions and 6 deletions
|
@ -356,12 +356,13 @@ async fn get_org_collections_details(org_id: &str, headers: ManagerHeadersLoose,
|
|||
})
|
||||
.collect();
|
||||
|
||||
// if current user is in any collection-assigned group or in a group having access to all collections
|
||||
if group_users.contains(&user_org.uuid) || all_access_group_uuids.contains(&user_org.uuid) {
|
||||
assigned = true;
|
||||
}
|
||||
|
||||
if user_org.access_all {
|
||||
// if current user is in any collection-assigned group
|
||||
// or in a group having access to all collections
|
||||
// or itself has access to all collections
|
||||
if group_users.contains(&user_org.uuid)
|
||||
|| all_access_group_uuids.contains(&user_org.uuid)
|
||||
|| user_org.access_all
|
||||
{
|
||||
assigned = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue