Mudit Mudit - 27 days ago 29
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

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

Am I missing anything?

Answer

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"
Comments