1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-08-02 00:59:08 +00:00

fix: format

This commit is contained in:
Richy 2025-07-09 19:04:17 +02:00 committed by Richy
commit 614c8be53b

View file

@ -1924,11 +1924,11 @@ impl CipherSyncData {
// Generate a HashMap with the collections_uuid as key and the CollectionGroup record
let user_collections_groups: HashMap<CollectionId, CollectionGroup> = if CONFIG.org_groups_enabled() {
CollectionGroup::find_by_user(user_id, conn)
.await
.into_iter()
.fold(HashMap::new(), |mut combined_permissions, cg| {
combined_permissions.entry(cg.collections_uuid.clone())
CollectionGroup::find_by_user(user_id, conn).await.into_iter().fold(
HashMap::new(),
|mut combined_permissions, cg| {
combined_permissions
.entry(cg.collections_uuid.clone())
.and_modify(|existing| {
// Combine permissions: take the most permissive settings.
existing.read_only &= cg.read_only; // false if ANY group allows write
@ -1937,7 +1937,8 @@ impl CipherSyncData {
})
.or_insert(cg);
combined_permissions
})
},
)
} else {
HashMap::new()
};