Hi,

A quick update. This double update issue happens when the
ResourceAccessManager implementation returns a "new
VectorAccessLimits(CatalogMode.HIDE, null, Filter.INCLUDE, null,
Filter.INCLUDE);" (which means no access limits at all for this particlar
resource)

For example
https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/security/DataAccessManagerAdapter.java
never returns such objects. The buildLimits() method of this class detects
if the user has unrestricted access to the resoruce in question and returns
"null" the limits. This is probably the reason why this issue hasn't come
up before.

As a workaround, I've switched the ResourceAccessManager in question to
return null for such cases as well. However I think this is a serious issue
in GS that needs to be looked at by someone who knows this design better.
Jody, any comments?


 Sampo

On Mon, Jun 29, 2015 at 12:45 PM, Sampo Savolainen <
[email protected]> wrote:

> Hi,
>
> I've got a case here where a WFS-T request ends up doing the UDPATE clause
> twice to the database table (using jdbc-oracle). This GeoServer that has a
> custom ResourceAccessManager that returns VectorAccessLimits. I'm using
> GeoServer 2.6.2, but I see no relevant updates to the code I'm referencing
> here in 2.6.x nor master.
>
> Debugging this ended up me looking here:
> https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/security/decorators/SecuredSimpleFeatureStore.java#L60
>
> The case I'm looking at ends up going to storeDelegate.modifyFeatures()
> twice, on rows #65 and #77.
>
> I've copied the relevant statements below. If the first if statement is
> true, then writeQuery.getPropertyNames() is a constant (=null) that is
> always equal to Query.ALL_NAMES (=null). What's the reasoning behind this?
> Is there a case where it makes sense for this method to do two updates?
>
> Query writeQuery = getWriteQuery(policy);
> if (writeQuery == Query.ALL) {
>     ((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values,
> filter);
> } else if (writeQuery.getFilter() == Filter.EXCLUDE
>         || writeQuery.getPropertyNames() == Query.NO_NAMES) {
>     throw unsupportedOperation();
> }
>
> // get the mixed filter
> final Query local = new Query(null, filter);
> Query mixed = mixQueries(local, writeQuery);
>
> if (writeQuery.getPropertyNames() == Query.ALL_NAMES) {
>     // it was just a matter of filtering.
>     ((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values,
> mixed.getFilter());
> } else {
>     ....
>
>
>  Sampo
>
> --
> Sampo Savolainen
> R&D Director, Spatineo Oy
> [email protected]
> +358-407555649
> Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
> www.spatineo.com, twitter.com/#!/spatineo
> www.linkedin.com/company/spatineo-inc
>
> This message may contain privileged and/or confidential information. If you
> have received this e-mail in error or are not the intended recipient, you
> may not use, copy, disseminate, or distribute it; do not open any
> attachments, delete it immediately from your system and notify the sender
> promptly by e-mail that you have done so.
>



-- 
Sampo Savolainen
R&D Director, Spatineo Oy
[email protected]
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to