3 Replies Latest reply on May 29, 2007 5:13 PM by Gavin King

    evaluting s:hasPermission once only in a page

    parag talekar Newbie

      i have a page with quite a few :

      <ice:inputText id="enterpriseName"
      value="#{enterpriseTreeManager.enterprise.name}" size="50"
      required="true"
      disabled="${!s:hasPermission('enterprise', 'edit', null}">

      i am using the RuleBasedIdentity, so I also have a security.drl file with all the premissions. my problem is that the Identity.hasPermission() method get called for each s:hasPermission. is there a way to store the result of s:hasPermission in a page scoped variable and then use that instead of s:hasPermission?

      i tried the following but it still calls Identity.hasPermission multiple times:
      <c:set var="editPermission" scope="page" value="${s:hasPermission('enterprise', 'edit', null)}"/>
      and then
      <ice:inputText id="enterpriseName"
      value="#{enterpriseTreeManager.enterprise.name}" size="50"
      required="true"
      disabled="${!editPermission}">


      thanks in advance