fix: check of some permission returned always false

This commit is contained in:
Julian Krauser 2025-05-07 09:05:55 +02:00
parent 56484020d8
commit 69b447a2d8

View file

@ -28,6 +28,7 @@ export default class PermissionHelper {
permissions[section]?.[module]?.includes(type) permissions[section]?.[module]?.includes(type)
) )
return true; return true;
return false; return false;
} }
@ -39,7 +40,7 @@ export default class PermissionHelper {
module: PermissionModule; module: PermissionModule;
}> }>
) { ) {
checks.reduce<boolean>((prev, curr) => { return checks.reduce<boolean>((prev, curr) => {
return prev || this.can(permissions, curr.requiredPermission, curr.section, curr.module); return prev || this.can(permissions, curr.requiredPermission, curr.section, curr.module);
}, false); }, false);
} }