Spring Security
  1. Spring Security
  2. SEC-524

Taglibs can define a scripting variable based on the logic result of the tag.

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.0.M1
    • Component/s: Taglibs
    • Labels:
      None

      Description

      Taglibs can define a scripting variable based on the logic result of the tag, similar to struts <bean:define /> in this case jsp looks like this:

      <%-- optional toScope attribute --%>
      <authz:authorize id="authorized" ifAnyGranted="ROLE_ADMIN" toScope="request" />
      <logic:iterate id="contact" name="person" property="contacts">
      <c:if test="authorized==true" >
      <bean:write name="contact" property="name" /><br>
      </c:if>
      </logic:iterate>

      to improve in performance of iteration over lists.

      I know that it is possible to be done in this way:

      <authz:authorize ifAnyGranted="ROLE_ADMIN">
      <bean:define id="authorized" value="true" type="boolean" />
      </authz:authorize>

      but it would be nice to include this feature to all taglibs. if a BaseTag is developed this could do that function, and the subclasses (AccessControlListTag, AclTag, AuthenticationTag, AuthorizeTag) inherit this functionality.

        Activity

        Hide
        Luke Taylor added a comment -

        I've added a "var" variable to th authorize and accesscontrollist tags which can be used to store the boolean result of the access decision.

        Show
        Luke Taylor added a comment - I've added a "var" variable to th authorize and accesscontrollist tags which can be used to store the boolean result of the access decision.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Ezequiel Chávez
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: