perf: refs #7995 has acl function

This commit is contained in:
Jon Elias 2025-04-01 09:34:38 +02:00
parent f8cc7b95ab
commit b00d89a4be
1 changed files with 3 additions and 8 deletions

View File

@ -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 {