3 Replies Latest reply on Jun 10, 2008 3:15 PM by Nicklas Karlsson

    Seam security s:hasRole in UI

    Guillaume Jeudy Master

      Hi,


      I use Seam 2.0.1GA and I found out an incorrect tip in the Seam security chapter: UI security.


      I tried using:


      <h:commandButton value="Create Rel Pkg" rendered="#{s.hasRole('USER')}"
      
                               action="#{packageAdminAction.startCreateReleasePackage}" />



      but it always evaluated to false. So I changed it to:


      <<h:commandButton value="Create Rel Pkg" rendered="#{identity.hasRole('USER')}"
      
                               action="#{packageAdminAction.startCreateReleasePackage}" />



      and now it works.


      Can someone please confirm this is a bug? The s.hasRole expression is properly processed in @Restrict annotation on component security.


      I suggest that the UI usage be made consistent with component security @Restrict usage.


      Thanks,
      -Guillaume