From 274ad680e225b2cf73239965e984bf77eaa4f364 Mon Sep 17 00:00:00 2001 From: MFijak Date: Mon, 8 Aug 2022 10:38:48 +0200 Subject: [PATCH] bugfix --- src/db/models/cipher.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/db/models/cipher.rs b/src/db/models/cipher.rs index 01c11bb1..e04adf15 100644 --- a/src/db/models/cipher.rs +++ b/src/db/models/cipher.rs @@ -565,7 +565,9 @@ impl Cipher { groups::uuid.eq(groups_users::groups_uuid) )) .left_join(collections_groups::table.on( - collections_groups::collections_uuid.eq(ciphers_collections::collection_uuid) + collections_groups::collections_uuid.eq(ciphers_collections::collection_uuid).and( + collections_groups::groups_uuid.eq(groups::uuid) + ) )) .filter(ciphers::user_uuid.eq(user_uuid)) // Cipher owner .or_filter(users_organizations::access_all.eq(true)) // access_all in org @@ -704,7 +706,9 @@ impl Cipher { groups::uuid.eq(groups_users::groups_uuid) )) .left_join(collections_groups::table.on( - collections_groups::collections_uuid.eq(ciphers_collections::collection_uuid) + collections_groups::collections_uuid.eq(ciphers_collections::collection_uuid).and( + collections_groups::groups_uuid.eq(groups::uuid) + ) )) .or_filter(users_collections::user_uuid.eq(user_id)) // User has access to collection .or_filter(users_organizations::access_all.eq(true)) // User has access all