From 17bdcec317b36bacd40f54ddbd23c23c2d53ab25 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Mon, 23 Jun 2025 19:45:08 +0200 Subject: [PATCH] [bug] Fix access verification in decryptAttribute --- src/services/service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/services/service.ts b/src/services/service.ts index e90e4b9..67cdaba 100755 --- a/src/services/service.ts +++ b/src/services/service.ts @@ -1057,11 +1057,13 @@ export default class Services { let hasAccess = false; // If we're not supposed to have access to this attribute, ignore for (const role of Object.values(roles)) { - if (role.validation_rules.includes(attribute)) { - if (role.members.includes(pairingProcessId)) { - // We have access to this attribute - hasAccess = true; - break; + for (const rule of Object.values(role.validation_rules)) { + if (rule.fields.includes(attribute)) { + if (role.members.includes(pairingProcessId)) { + // We have access to this attribute + hasAccess = true; + break; + } } } }