refactor: refs #7995 modified hasAcl function
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jon Elias 2025-03-31 09:51:40 +02:00
parent c03a56f69f
commit f8cc7b95ab
1 changed files with 7 additions and 6 deletions

View File

@ -32,12 +32,13 @@ export function useAcl() {
function hasAcl(model, props, accessType) {
const modelAcl = state.getAcls().value[model];
const access = modelAcl[props];
if (!modelAcl || !access) return false;
if (access[accessType] || access['*']) {
return true;
}
return false;
const propAcl = modelAcl[props] || {};
return !!(
propAcl[accessType] ||
modelAcl['*']?.[accessType] ||
propAcl['*'] ||
modelAcl['*']?.['*']
);
}
return {