samedi 14 septembre 2013

PrimeFaces EL Extensions for UI Authorization


  • #{p:ifGranted(‘ROLE_ADMIN’)} 
  • #{p:ifAllGranted(‘ROLE_EDITOR, ROLE_APPROVER’)} 
  • #{p:ifAnyGranted(‘ROLE_USER, ROLE_ADMIN’)} 
  • #{p:ifNotGranted(‘ROLE_GUEST’)} 
  • #{p:remoteUser()} 
  • #{p:userPrincipal()} 
<h:commandButton value="Delete" rendered="#{p:ifGranted('ROLE_ADMIN')}" />
<p:commandButton value="View" disabled="#{p:ifNotGranted('ROLE_USER, ROLE_ADMIN')}" />