From bd3f488023cbc11b329f363e5eea94096ff3b9ac Mon Sep 17 00:00:00 2001 From: BlackDex Date: Wed, 4 Mar 2026 18:09:21 +0100 Subject: [PATCH] Fix collection details response Signed-off-by: BlackDex --- src/api/core/organizations.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 4a5066ab..64f835e2 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -395,7 +395,8 @@ async fn get_org_collections_details(org_id: OrganizationId, headers: ManagerHea Membership::find_confirmed_by_org(&org_id, &conn).await.into_iter().map(|m| (m.uuid, m.atype)).collect(); // check if current user has full access to the organization (either directly or via any group) - let has_full_access_to_org = member.access_all + // let has_full_access_to_org = headers.membership.has_full_access(); + let has_full_access_to_org = member.has_full_access() || (CONFIG.org_groups_enabled() && GroupUser::has_full_access_by_member(&org_id, &member.uuid, &conn).await); // Get all admins, owners and managers who can manage/access all @@ -421,6 +422,11 @@ async fn get_org_collections_details(org_id: OrganizationId, headers: ManagerHea || (CONFIG.org_groups_enabled() && GroupUser::has_access_to_collection_by_member(&col.uuid, &member.uuid, &conn).await); + // If the user is a manager, and is not assigned to this collection, skip this and continue with the next collection + if !assigned { + continue; + } + // get the users assigned directly to the given collection let mut users: Vec = col_users .iter()