📜  星云菜单项已禁用 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:37.002000             🧑  作者: Mango

代码示例1
// 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;
  }
}