TransWikia.com

How to specify Layer details with the GeoFence REST API using an external GeoFence server?

Geographic Information Systems Asked by Jutilae on January 8, 2021

I’m using an external GeoFence server with a GeoServer cluster. My question is that, is it possible to specify the Layer Details with the external GeoFence REST API and what is the correct syntax for variables Allowed Area and Catalog Mode? I would like to create ca. 300 users with different geographical restrictions and can’t find the solution from the documentation (https://github.com/geoserver/geofence/wiki/GeoFence-REST-API).

Here are two screenshots that demonstrate the rule created with the GUI of the webapp.
enter image description here
enter image description here

Here’s an example rule that I would like to create using VSCODE REST Client.

POST http://**********/geofence/rest/rules HTTP/1.1
content-type: application/xml
Authorization: Basic ********:*********

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rule grant="LIMIT">
    <position value="0" position="offsetFromTop"/>
    <username>
        helsinki
    </username>
    <rolename>
        käyttäjät
    </rolename>
    <instance>
        <name>tomcat2</name>
    </instance>
    <service>*</service>
    <request>*</request>
    <workspace>yleiskaava</workspace>
    <layer>rasteri_prod</layer>
    <layerDetails>
<allowedArea>
SRID=4326;MULTIPOLYGON(((25.23817754531389213 60.29533227078006519, 25.22952012148912715 60.29784001296140872…)))
           </allowedArea>
           <catalogMode>CHALLENGE</catalogMode>
    </layerDetails>  
</rule>

And here’s what I get as a result. I could add the details by hand but not for 300+ rules. Is this possible with the GeoFence REST API?
enter image description here

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP