refactor: refs #7995 modified hasAcl function
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
c03a56f69f
commit
f8cc7b95ab
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue