Skip to content

Commit

Permalink
optimize condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
matlink committed Aug 5, 2023
1 parent d282b32 commit 930adb8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/api/core/organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,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;
}

Expand Down

0 comments on commit 930adb8

Please sign in to comment.