Mudit Mudit - 1 year ago 200
AngularJS Question

has-any-authorithy directive in jhipster application

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.

I am using it in HTML like


Am I missing anything?

Answer Source

Code says:

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

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

Try this:

has-any-authority="ROLE_ADMIN, ROLE_SUPERUSER"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download