ArcGIS Enterprise SDK
Layer Access SOI (ArcGIS Enterprise SDK)
ArcGIS Enterprise SDK Developer Help > Developing Extensions with ArcGIS Enterprise SDK > Developing With Java > Java Samples > Layer Access SOI (ArcGIS Enterprise SDK)

Layer Access SOI Sample


Purpose
This sample demonstrates two things:
  • How to handle REST, SOAP, and binary requests.
  • How to implement layer level controls and conditionally give access to certain layers based on an external permissions file.
As part of the handling of SOAP and binary requests, this samples makes use of the SOIHelper class to show how to call into the ArcGIS Server default operation handlers.
Note that this sample is not comprehensive in what operations are intercepted. Developers should use this as the basis for learning how to implement security related functionality, but all production code should be carefully vetted to ensure that all appropriate operations are handled and no information is inadvertently leaked or made accessible.
This sample is dependent on a file named permission.json to be present in the directory containing the arcgisoutput server directory. For example, in a default Windows installation this is C:\arcgisserver.

How to use this sample

  1. Deploy the lib/LayerAccessSOI_ent.soe file to Server. For instructions on how to deploy an SOI, refer to the topic Deploying Extensions.
  2. Enable the SOI on the map service of your choice. For instructions on how to enable an SOI on a map service, refer to the topic Enabling Extensions. Ensure that the map service has at least one feature layer.
  3. Make sure the “permission.json” file is copied to an appropriate path (the default path is C:\arcgisserver), that the ap service has all feature layers, and that the layers are matching with indexes for layers defined in the “permission.json” file.
  4. Disable the REST cache for map service, where the SOI is enabled.
  5. After the map service has started with the SOI enabled on it, open the Services Directory and access the http://<serverdomain>/<webadaptorname>/rest/services page.
  6. Access the service with one defined user in the “permission.json” file.
  7. Click on the “ArcGIS JavaScript” link available inside the “View In” section.
  8. Note how certain layers are only visible when the request is authenticated and matches the permissions defined in the “permission.json” file.
  9. Repeat steps 6, 7, and 8 for different users.