📅  最后修改于: 2022-03-11 14:55:37.002000             🧑  作者: Mango
// hide menu when user doesn't have the role and permissions.
if (prepared.roles && prepared.roles.length > 0) {
const role = this.authService.getUser().role;
if (prepared.roles.indexOf(role) === -1) {
prepared.hidden = true;
}
}