From dcc2f4dfde6ba958c59938c316f57327ca8a2a66 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 1 Aug 2024 14:14:28 +0200 Subject: [PATCH] chore: refs #4074 admit several acls --- src/composables/useAcl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/composables/useAcl.js b/src/composables/useAcl.js index 46aaa3c25..be6dbc241 100644 --- a/src/composables/useAcl.js +++ b/src/composables/useAcl.js @@ -16,10 +16,11 @@ export function useAcl() { state.setAcls(acls); } - function hasAny(model, prop, accessType) { + function hasAny(model, props = [], accessType) { const acls = state.getAcls().value[model]; + Array.isArray(props) || (props = [props]); if (acls) - return ['*', prop].some((key) => { + return ['*', ...props].some((key) => { const acl = acls[key]; return acl && (acl['*'] || acl[accessType]); });