From 4f6a7b31fbbb6d36221b342318d8007d2ec691c8 Mon Sep 17 00:00:00 2001 From: marie flores Date: Fri, 10 Jan 2025 15:29:29 +0100 Subject: [PATCH] [backend] handle inferred organizations in organization sharing --- opencti-platform/opencti-graphql/src/database/engine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencti-platform/opencti-graphql/src/database/engine.js b/opencti-platform/opencti-graphql/src/database/engine.js index b6e76620cae0..48e6770fffb7 100644 --- a/opencti-platform/opencti-graphql/src/database/engine.js +++ b/opencti-platform/opencti-graphql/src/database/engine.js @@ -501,7 +501,7 @@ export const buildDataRestrictions = async (context, user, opts = {}) => { // Data with Empty granted_refs are not visible // Data with granted_refs users that participate to at least one const should = [excludedEntityMatches]; - const shouldOrgs = user.allowed_organizations + const shouldOrgs = user.organizations .map((m) => ({ match: { [buildRefRelationSearchKey(RELATION_GRANTED_TO)]: m.internal_id } })); should.push(...shouldOrgs); // User individual or data created by this individual must be accessible