Package org.geoserver.security

Examples of org.geoserver.security.CoverageAccessLimits


                .getBean("testResourceAccessManager");
        Catalog catalog = getCatalog();
        CoverageInfo world = catalog.getCoverageByName(getLayerId(MockData.WORLD));

        // limits for mr cite_noworld: can't access the world layer
        tam.putLimits("cite_noworld", world, new CoverageAccessLimits(CatalogMode.HIDE,
                Filter.EXCLUDE, null, null));

        // limits for mr cite_noworld: can't access the world layer
        tam.putLimits("cite_noworld_challenge", world, new CoverageAccessLimits(
                CatalogMode.CHALLENGE, Filter.EXCLUDE, null, null));

        // limits the area to north america
        MultiPolygon rasterFilter = (MultiPolygon) new WKTReader().read("MULTIPOLYGON(((-120 30, -120 60, -60 60, -60 30, -120 30)))");
        tam.putLimits("cite_usa", world, new CoverageAccessLimits(CatalogMode.HIDE, null,
                rasterFilter, null));
    }
View Full Code Here


    public GridCoverage2D read(GeneralParameterValue[] parameters) throws IllegalArgumentException,
            IOException {
        MultiPolygon rasterFilter = null;
        if (policy.getLimits() instanceof CoverageAccessLimits) {
            CoverageAccessLimits limits = (CoverageAccessLimits) policy.getLimits();

            // get the crop filter
            rasterFilter = limits.getRasterFilter();
            Filter readFilter = limits.getReadFilter();

            // update the read params
            final GeneralParameterValue[] limitParams = limits.getParams();
            if (parameters == null) {
                parameters = limitParams;
            } else if (limitParams != null) {
                // scan the input params, add and overwrite with the limits params as needed
                List<GeneralParameterValue> params = new ArrayList<GeneralParameterValue>(Arrays
View Full Code Here

                .getBean("testResourceAccessManager");
       
        // tile filtering setup
        CoverageInfo coverage = catalog.getCoverageByName("sf:mosaic");
        Filter green = CQL.toFilter("location like 'green%'");
        tam.putLimits("cite_mosaic1", coverage, new CoverageAccessLimits(CatalogMode.HIDE, green, null, null));
       
        // image cropping setup
        WKTReader wkt = new WKTReader();
        MultiPolygon cropper = (MultiPolygon) wkt.read("MULTIPOLYGON(((0 0, 0.5 0, 0.5 0.5, 0 0.5, 0 0)))");
        tam.putLimits("cite_mosaic2", coverage, new CoverageAccessLimits(CatalogMode.HIDE, green, cropper, null));

        // add a wms store too, if possible
        if (!RemoteOWSTestSupport.isRemoteWMSStatesAvailable(LOGGER)) {
            return;
        }
View Full Code Here

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

            return new CoverageAccessLimits(catalogMode, readFilter, rasterFilter, null);
        }
        else if (resource instanceof WMSLayerInfo)
        {
            MultiPolygon rasterFilter = buildRasterFilter(rule);
View Full Code Here

                .getBean("testResourceAccessManager");
        Catalog catalog = getCatalog();
        CoverageInfo world = catalog.getCoverageByName(getLayerId(MockData.WORLD));

        // limits for mr cite_noworld: can't access the world layer
        tam.putLimits("cite_noworld", world, new CoverageAccessLimits(CatalogMode.HIDE,
                Filter.EXCLUDE, null, null));

        // limits for mr cite_noworld: can't access the world layer
        tam.putLimits("cite_noworld_challenge", world, new CoverageAccessLimits(
                CatalogMode.CHALLENGE, Filter.EXCLUDE, null, null));

        // limits the area to north america
        MultiPolygon rasterFilter = (MultiPolygon) new WKTReader()
                .read("MULTIPOLYGON(((-120 30, -120 60, -60 60, -60 30, -120 30)))");
        tam.putLimits("cite_usa", world, new CoverageAccessLimits(CatalogMode.HIDE, null,
                rasterFilter, null));
    }
View Full Code Here

       

        CoverageInfo coverage = catalog.getCoverageByName("sf:mosaic");
       
        //layer disable
        tam.putLimits("cite_nomosaic", coverage, new CoverageAccessLimits(CatalogMode.HIDE, Filter.EXCLUDE, null, null));
       
        // image cropping setup
        WKTReader wkt = new WKTReader();
        MultiPolygon cropper = (MultiPolygon) wkt.read("MULTIPOLYGON(((140 -50, 150 -50, 150 -30, 140 -30, 140 -50)))");
        tam.putLimits("cite_cropmosaic", coverage, new CoverageAccessLimits(CatalogMode.HIDE, Filter.INCLUDE, cropper, null));
       
        // filter setup
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.contains(ff.property("geometry"), ff.literal(cropper));
        tam.putLimits("cite_filtermosaic", coverage, new CoverageAccessLimits(CatalogMode.HIDE, filter, null, null));
       
    }
View Full Code Here

public class LocalWorkspaceResourceAccessManager extends ResourceAccessManagerWrapper {
    private DataAccessLimits hide(ResourceInfo info) {
        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

    public GridCoverage2D read(GeneralParameterValue[] parameters) throws IllegalArgumentException,
            IOException {
        MultiPolygon rasterFilter = null;
        if (policy.getLimits() instanceof CoverageAccessLimits) {
            CoverageAccessLimits limits = (CoverageAccessLimits) policy.getLimits();

            // get the crop filter
            rasterFilter = limits.getRasterFilter();

            // update the read params
            final GeneralParameterValue[] limitParams = limits.getParams();
            if (parameters == null) {
                parameters = limitParams;
            } else if (limitParams != null) {
                // scan the input params, add and overwrite with the limits params as needed
                List<GeneralParameterValue> params = new ArrayList<GeneralParameterValue>(Arrays
View Full Code Here

TOP

Related Classes of org.geoserver.security.CoverageAccessLimits

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.