jhipster应用程序中的具有any-authorithy指令 [英] has-any-authorithy directive in jhipster application

查看:144
本文介绍了jhipster应用程序中的具有any-authorithy指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jhipster应用程序中创建了一个新角色ROLE_SUPERUSER.我希望特定的导航栏菜单仅对管理员和我的新用户可见. 我尝试使用Authority.directive.js中提供的has-any-authorithy,但无法正常工作.

I have created a new role ROLE_SUPERUSER in my jhipster application. I want a specific navbar menu to be visible to only admin and my new user. I tried using has-any-authorithy as given in authority.directive.js but its not working.

我正在

has-any-authorithy ="['ROLE_ADMIN','ROLE_SUPERUSER']"

has-any-authorithy="['ROLE_ADMIN','ROLE_SUPERUSER']"

我想念什么吗?

推荐答案

代码说:

authorities = attrs.hasAnyAuthority.replace(/\s+/g, '').split(',');

因此,该指令似乎期望一个字符串而不是一个数组.

So it seems that the directive expects one string and not an array.

尝试一下:

has-any-authority="ROLE_ADMIN, ROLE_SUPERUSER"

这篇关于jhipster应用程序中的具有any-authorithy指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆