mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-16 07:52:31 +00:00
prevent side effects if groups are disabled (#4265)
This commit is contained in:
parent
5e46a43306
commit
1b801406d6
4 changed files with 226 additions and 126 deletions
|
@ -1788,15 +1788,22 @@ impl CipherSyncData {
|
|||
.collect();
|
||||
|
||||
// Generate a HashMap with the collections_uuid as key and the CollectionGroup record
|
||||
let user_collections_groups: HashMap<String, CollectionGroup> = CollectionGroup::find_by_user(user_uuid, conn)
|
||||
.await
|
||||
.into_iter()
|
||||
.map(|collection_group| (collection_group.collections_uuid.clone(), collection_group))
|
||||
.collect();
|
||||
let user_collections_groups: HashMap<String, CollectionGroup> = if CONFIG.org_groups_enabled() {
|
||||
CollectionGroup::find_by_user(user_uuid, conn)
|
||||
.await
|
||||
.into_iter()
|
||||
.map(|collection_group| (collection_group.collections_uuid.clone(), collection_group))
|
||||
.collect()
|
||||
} else {
|
||||
HashMap::new()
|
||||
};
|
||||
|
||||
// Get all organizations that the user has full access to via group assignment
|
||||
let user_group_full_access_for_organizations: HashSet<String> =
|
||||
Group::gather_user_organizations_full_access(user_uuid, conn).await.into_iter().collect();
|
||||
let user_group_full_access_for_organizations: HashSet<String> = if CONFIG.org_groups_enabled() {
|
||||
Group::gather_user_organizations_full_access(user_uuid, conn).await.into_iter().collect()
|
||||
} else {
|
||||
HashSet::new()
|
||||
};
|
||||
|
||||
Self {
|
||||
cipher_attachments,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue