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

Comments

Popular posts from this blog

How to get Active Transactions and Locks from MySQL

Example of a PAC file