Select to view content in your preferred language

Arcgis server 10.9.1 SOI get user groups

1546
9
08-01-2022 12:00 AM
Dvirus
by
Occasional Contributor

Hi,

I am trying to get user groups in SOI in Arcgis server 10.9.1

HashSet<String> userRoleSet = ServerUtilities.GetGroupInfo(ServerUtilities.GetServerEnvironment());

It's working with MapServer but in FeatureServer it's return null.

Any suggestions? 

 

 

0 Kudos
9 Replies
nicogis
MVP Frequent Contributor

do you mean FeatureServer in a service MapServer o hosted feature layer ?

0 Kudos
Dvirus
by
Occasional Contributor

 FeatureServer hosted by ArcgisServer

0 Kudos
nicogis
MVP Frequent Contributor

SOIs are appropriate if you're looking to change the behavior of existing map or image service operations (including map and image service extensions, such as feature service operations)

 

0 Kudos
Dvirus
by
Occasional Contributor

I am looking to change the behavior of existing FeatureServer service.

with MapService I can get the user roles set but not in FeatureServer.

(Published on the same server)

0 Kudos
nicogis
MVP Frequent Contributor

Is your featureserver a feature service operations of map server ?

0 Kudos
Dvirus
by
Occasional Contributor

Yes.

0 Kudos
Amir-Sarrafzadeh-Arasi
Occasional Contributor

Dear Dvirusb, 

you can do this by getting the number of groups and then do a for loop to get all of them.

int iteration = ServerUtilities.getGroupInfo().size();

var roles = ServerUtilities.getServerUserInfo().getRoles();
var groups = ServerUtilities.getGroupInfo();

for (int i = 0; i <= iteration; i++) {

serverLog.addMessage(3, 200, "role of the " + user + " is " + roles.next());

}

 

I hope it works for you. If you need more clarification you can contact me by:

amir@wheretech.it

 

Amir Sarrafzadeh Arasi
0 Kudos
nicogis
MVP Frequent Contributor

It seems related to this problem : BUG-000102477 for ArcGIS GIS Server (esri.com)  but I  see that 10.5 ...

Have use set disableCache property in service ? (see coding-practices-for-extensions )

 

0 Kudos
Dvirus
by
Occasional Contributor

Feature service are not cached by default so setting

"disableCaching": "true",

 affected only MapServer.

This bug occurs also in version 11.1 - fully patched.

 

 

0 Kudos