you can see the sample in sdk arcobjects:
C:\Program Files (x86)\ArcGIS\DeveloperKit10.4\Samples\ArcObjectsNet\ServerLayerAccessSOI
Hi, thanks!
I need anyway a sample about data access inside a layer (so filter rows based on user role). Do you know anyone?
Thank you
Fabio
you can see this sample devsummit-berlin-2015-SOI/FilterAccessSOI at b6b41e77f873ffd0b1c868cb04dc754cb37f58e1 · ceddc/devsum... and use layerDefs of ExportMap Rest to filter rows using a definition expressions
Dear Fabio,
I hope you are doing well,
You should first get the user role with this code ("java"):
var roles = ServerUtilities.getServerUserInfo().getRoles();
var role = roles.next();
variable rules icludes roles of the user which is entered and then the id_groups of the user who is member of them, so if you want to get the id_groups of the groups you should do .next() again.
the you should create a JSONObject and define the whereclause and put in it:
JSONObject inputParams = new JSONObject(operationInput);
inputParams.put("where", "Here you should put your clause in SQL format");
operationInput = inputParams.toString();
if you want to filter specific layers of specific field you can use these codes,
inputParams.put("layers", "0");
inputParams.put("layerDefs", layerDefs);
Best regards.