top.xhtml

Definimos el menú

 <b:navBar brand="#{msg['application.shorttitle']}"
              brandHref="" inverse="true"
              fixed="top">

Crearemos un menu para invocar las paginas:

index.xhtml

  • index.xhtml

  • /pages/rol/list.xhtml

  • /pages/usuario/list.xhtml

  • Invocar la opciòn de logout

Validamos los permisos de acceso mediante el APi Java EE 8 Security Api, usando ifGranted

<b:dropMenu value="#{msg['menubar.administracion']}"  rendered="#{p:ifGranted('ADMINISTRADOR')}">

Si deseamos evaluar varios roles, simplemente usamos ifAnyGranted y la lista de permisos.

<b:dropMenu value="#{msg['menubar.solicitud']}" rendered="#{p:ifAnyGranted('ADMINISTRADOR, DOCENTE, ADMINISTRATIVO')}">

template.xhtml

Last updated

Was this helpful?