Package org.geoserver.security

Examples of org.geoserver.security.WMSAccessLimits


            if(layer instanceof SecuredWMSLayer) {
                SecuredWMSLayer secured = (SecuredWMSLayer) layer;
                final WrapperPolicy policy = secured.getPolicy();
                // check if we can cascade GetFeatureInfo
                if(policy.getLimits() instanceof WMSAccessLimits) {
                    WMSAccessLimits limits = (WMSAccessLimits) policy.getLimits();
                    if(!limits.isAllowFeatureInfo()) {
                        if(policy.getResponse() == org.geoserver.security.Response.CHALLENGE) {
                            SecureCatalogImpl.unauthorizedAccess(layer.getName());
                        } else {
                            throw new IllegalArgumentException("Layer " + layer.getName() + " is not queriable");
                        }
View Full Code Here


        return policy;
    }
   
    public boolean isQueryable() {
        if(policy.getLimits() instanceof WMSAccessLimits) {
            WMSAccessLimits wl = (WMSAccessLimits) policy.getLimits();
            if(!wl.isAllowFeatureInfo()) {
                return false;
            }
        }
        return delegate.isQueryable();
    }
View Full Code Here

        catalog.add(states);
        LayerInfo layer = cb.buildLayer(states);
        catalog.add(layer);

        // hide the layer to cite_nostates
        tam.putLimits("cite_nostates", states, new WMSAccessLimits(CatalogMode.HIDE,
                Filter.EXCLUDE, null, false));
        // disallow getfeatureinfo on the states layer
        tam.putLimits("cite_noinfo", states, new WMSAccessLimits(CatalogMode.HIDE, Filter.INCLUDE,
                null, false));
        // cascade CQL filter, allow feature info
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Filter texas = ff.equal(ff.property("STATE_NAME"), ff.literal("Texas"), false);
        tam.putLimits("cite_texas", states,
                new WMSAccessLimits(CatalogMode.HIDE, texas, null, true));
    }
View Full Code Here

        }
        else if (resource instanceof WMSLayerInfo)
        {
            MultiPolygon rasterFilter = buildRasterFilter(rule);

            return new WMSAccessLimits(catalogMode, readFilter, rasterFilter, true);
        }
        else
        {
            throw new IllegalArgumentException("Don't know how to handle resource " + resource);
        }
View Full Code Here

                if(policy.getResponse() == org.geoserver.security.Response.CHALLENGE) {
                    SecureCatalogImpl.unauthorizedAccess(layer.getName());
                }
                // collect read filters
                if(policy.getLimits() instanceof WMSAccessLimits) {
                    WMSAccessLimits limits = (WMSAccessLimits) policy.getLimits();
                    layerFilters.add(limits.getReadFilter());
                    layerFiltersFound |= limits.getReadFilter() != null;
                   
                    if(limits.getRasterFilter() != null) {
                        /*
                         * To implement this we'd have to change the code in
                         * SecuredWebMapServer.issueRequest(GetMapRequest) to parse the image,
                         * apply a crop, and encode it back.
                         * Also, if there are multiple layers in the request we'd have to group
View Full Code Here

        // populate the access manager
        TestResourceAccessManager tam = (TestResourceAccessManager) applicationContext
                .getBean("testResourceAccessManager");

        // hide the layer to cite_nostates
        tam.putLimits("cite_nostates", states, new WMSAccessLimits(CatalogMode.HIDE,
                Filter.EXCLUDE, null, false));
        // disallow getfeatureinfo on the states layer
        tam.putLimits("cite_noinfo", states, new WMSAccessLimits(CatalogMode.HIDE, Filter.INCLUDE,
                null, false));
        // cascade CQL filter, allow feature info
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Filter texas = ff.equal(ff.property("STATE_NAME"), ff.literal("Texas"), false);
        tam.putLimits("cite_texas", states,
                new WMSAccessLimits(CatalogMode.HIDE, texas, null, true));
    }
View Full Code Here

                if(policy.getResponse() == org.geoserver.security.Response.CHALLENGE) {
                    SecureCatalogImpl.unauthorizedAccess(layer.getName());
                }
                // collect read filters
                if(policy.getLimits() instanceof WMSAccessLimits) {
                    WMSAccessLimits limits = (WMSAccessLimits) policy.getLimits();
                    layerFilters.add(limits.getReadFilter());
                    layerFiltersFound |= limits.getReadFilter() != null;
                   
                    if(limits.getRasterFilter() != null) {
                        /*
                         * To implement this we'd have to change the code in
                         * SecuredWebMapServer.issueRequest(GetMapRequest) to parse the image,
                         * apply a crop, and encode it back.
                         * Also, if there are multiple layers in the request we'd have to group
View Full Code Here

        return policy;
    }
   
    public boolean isQueryable() {
        if(policy.getLimits() instanceof WMSAccessLimits) {
            WMSAccessLimits wl = (WMSAccessLimits) policy.getLimits();
            if(!wl.isAllowFeatureInfo()) {
                return false;
            }
        }
        return delegate.isQueryable();
    }
View Full Code Here

        if (info instanceof FeatureTypeInfo) {
            return new VectorAccessLimits(CatalogMode.HIDE, null, Filter.EXCLUDE, null, Filter.EXCLUDE);
        } else if (info instanceof CoverageInfo) {
            return new CoverageAccessLimits(CatalogMode.HIDE, Filter.EXCLUDE, null, null);
        } else if (info instanceof WMSLayerInfo) {
            return new WMSAccessLimits(CatalogMode.HIDE, Filter.EXCLUDE, null, false);
        } else {
            // TODO: Log warning about unknown resource type
            return new DataAccessLimits(CatalogMode.HIDE, Filter.EXCLUDE);
        }
    }
View Full Code Here

            if(layer instanceof SecuredWMSLayer) {
                SecuredWMSLayer secured = (SecuredWMSLayer) layer;
                final WrapperPolicy policy = secured.getPolicy();
                // check if we can cascade GetFeatureInfo
                if(policy.getLimits() instanceof WMSAccessLimits) {
                    WMSAccessLimits limits = (WMSAccessLimits) policy.getLimits();
                    if(!limits.isAllowFeatureInfo()) {
                        if(policy.getResponse() == org.geoserver.security.Response.CHALLENGE) {
                            SecureCatalogImpl.unauthorizedAccess(layer.getName());
                        } else {
                            throw new IllegalArgumentException("Layer " + layer.getName() + " is not queriable");
                        }
View Full Code Here

TOP

Related Classes of org.geoserver.security.WMSAccessLimits

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.