Uploaded image for project: 'MyFaces Tobago'
  1. MyFaces Tobago
  2. TOBAGO-2121

AuthorizationHelper fails which composite component attribute as method parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0.0
    • 5.1.0
    • Core
    • None

    Description

      I have a custom component which uses  cc.attrs.value as method argument

       

       

      <cc:interface>
      <cc:attribute name="value" type="String"/>
      </cc:interface>
      
      <cc:implementation>
      <tc:link action="#{someController.viewDetails(cc.attrs.value, facesContext)}" />
      ...
      

       

       

      The AuthorizationHelper fails with an StringIndexOutOfBoundsException

       

      java.lang.StringIndexOutOfBoundsException: begin 39, end 38, length 60
          at java.base/java.lang.String.checkBoundsBeginEnd(Unknown Source) ~[na:na]
          at java.base/java.lang.String.substring(Unknown Source) ~[na:na]
          at org.apache.myfaces.tobago.internal.util.AuthorizationHelper.getSecurityAnnotation(AuthorizationHelper.java:166) ~[tobago-core-5.0.0.jar!/:5.0.0]
          at org.apache.myfaces.tobago.internal.util.AuthorizationHelper.isAuthorized(AuthorizationHelper.java:81) ~[tobago-core-5.0.0.jar!/:5.0.0]
          at org.apache.myfaces.tobago.internal.component.AbstractUICommandBase.isAllowed(AbstractUICommandBase.java:128) ~[tobago-core-5.0.0.jar!/:5.0.0]
          at org.apache.myfaces.tobago.internal.component.AbstractUICommandBase.isDisabled(AbstractUICommandBase.java:120) ~[tobago-core-5.0.0.jar!/:5.0.0]
          at org.apache.myfaces.tobago.internal.renderkit.renderer.CommandRendererBase.encodeBeginInternal(CommandRendererBase.java:67) ~[tobago-core-5.0.0.jar!/:5.0.0]
          at org.apache.myfaces.tobago.internal.renderkit.renderer.CommandRendererBase.encodeBeginInternal(CommandRendererBase.java:59) ~[tobago-core-5.0.0.jar!/:5.0.0]
          at org.apache.myfaces.tobago.renderkit.RendererBase.encodeBegin(RendererBase.java:87) ~[tobago-core-5.0.0.jar!/:5.0.0]
          at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:597) ~[myfaces-api-2.3.9.jar!/:2.3.9]
          at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:527) ~[myfaces-api-2.3.9.jar!/:2.3.9]
          at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:551) ~[myfaces-api-2.3.9.jar!/:2.3.9]

      Attachments

        Activity

          People

            lofwyr Udo Schnurpfeil
            crusadah Carsten Dimmek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: