From b00d89a4bee022b8810ff7b308332e8691cce30f Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 1 Apr 2025 09:34:38 +0200 Subject: [PATCH] perf: refs #7995 has acl function --- src/composables/useAcl.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/composables/useAcl.js b/src/composables/useAcl.js index 4033ee9a6..52704fee9 100644 --- a/src/composables/useAcl.js +++ b/src/composables/useAcl.js @@ -30,15 +30,10 @@ export function useAcl() { return false; } - function hasAcl(model, props, accessType) { + function hasAcl(model, prop, accessType) { const modelAcl = state.getAcls().value[model]; - const propAcl = modelAcl[props] || {}; - return !!( - propAcl[accessType] || - modelAcl['*']?.[accessType] || - propAcl['*'] || - modelAcl['*']?.['*'] - ); + const propAcl = modelAcl?.[prop] || modelAcl?.['*']; + return !!(propAcl?.[accessType] || propAcl?.['*']); } return {