Uploaded image for project: 'GeoServer'
  1. GEOS-7459

Securing an app-schema data store may result in ClassCastException being thrown

    Details

      Description

      When trying to access a secured layer backed by an app-schema data store, or, more generally, any secured layer backed by a data store serving non-simple features, the following exception may be thrown:

      Caused by: java.lang.ClassCastException: org.geoserver.security.decorators.ReadOnlyDataAccess cannot be cast to org.geotools.data.DataStore
      	at org.geoserver.security.decorators.SecuredDataStoreInfo.getDataStore(SecuredDataStoreInfo.java:48)
      	at org.geoserver.security.decorators.SecuredDataStoreInfo.getDataStore(SecuredDataStoreInfo.java:1)
      	at org.geoserver.web.demo.PreviewLayer.findGmlVersion(PreviewLayer.java:303)
      	at org.geoserver.web.demo.PreviewLayer.getGmlLink(PreviewLayer.java:261)
      	at org.geoserver.web.demo.MapPreviewPage$1.getComponentForProperty(MapPreviewPage.java:96)
      	at org.geoserver.web.wicket.GeoServerTablePanel$4.populateItem(GeoServerTablePanel.java:212)
      	at org.apache.wicket.markup.html.list.ListView.onPopulate(ListView.java:562)
      	at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:131)
      	at org.apache.wicket.Component.internalBeforeRender(Component.java:1071)
      	at org.apache.wicket.Component.beforeRender(Component.java:1105)
      	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)
      	... 117 more
      

      Simplest solution would be to make the getDataStore method in SecuredDataStoreInfo return a DataAccess<? extends FeatureType, ? extends Feature> instead of a simple DataStore. Note that this is already the case in DecoratingDataStoreInfo, which is SecuredDataStoreInfo's parent class.

        Attachments

          Activity

            People

            • Assignee:
              ridethepenguin Stefano Costa
              Reporter:
              ridethepenguin Stefano Costa
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: