From 7de8bb17b5f0402dbe76ec04dd8957c241a9b9c3 Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Mon, 16 Oct 2023 13:59:50 +0200 Subject: [PATCH] chore: fix hasAuthorities check --- .../Interpretations/common/getInterpretationAccess.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Interpretations/common/getInterpretationAccess.js b/src/components/Interpretations/common/getInterpretationAccess.js index 1723b9e4c..11123bc63 100644 --- a/src/components/Interpretations/common/getInterpretationAccess.js +++ b/src/components/Interpretations/common/getInterpretationAccess.js @@ -6,7 +6,9 @@ const hasAuthority = (authorities, authority) => { `"hasAuthority" requires "authority" to be a populated string but received ${authority}` ) } - if (!(Array.isArray(authorities) || authorities instanceof Set)) { + if ( + !(Array.isArray(authorities) || typeof authorities?.has === 'function') + ) { throw new Error( `"hasAuthority" requires "authorities" to be an array or set of authorities (strings)` )