Search This Blog

Tuesday, November 13, 2018

How to Get User Role in JSF

In bean:

FacesContext.getCurrentInstance().getExternalContext().isUserInRole("user");

In JSF page:

<h:panelGroup rendered="#{facesContext.externalContext.isUserInRole('manager')}">
...
</h:panelGroup>

See also:

Common security annotations in Java EE