in src/utils/AuthButton.js [40:63]
export function checkButtonAuth(perms, permissions) {
if (
perms &&
permissions &&
permissions.button &&
permissions.button.length > 0
) {
if (buttonCache && buttonCache[perms]) {
return buttonCache[perms];
}
let { button: functionsList } = permissions;
let authFunctions = functionsList.filter((item) => {
return item.perms === perms;
});
const authFunction =
authFunctions && authFunctions.length > 0 ? authFunctions[0] : null;
if (authFunction) {
buttonCache.perms = authFunction;
}
return authFunction;
} else {
return false;
}
}