ServerUtilities does not return login user when the Service Directory page is accessed and the Directory page content can not be customized based on the ArcGIS Server login user.
The behavior is due to cache for service directory content. By default, map services have cache enabled. To customize service directory content based on user logins, cache must be disabled via Server Admin API.
- Navigate to https://gisserver.domain.com:6443/arcgis/admin/services/YourMapService.MapServer
- Click edit.
- In the properties section of the service JSON, add disableCaching property and set its value to true, for example:
"properties": {
...
"disableCaching": "true",
...
},
- Click Save Edits. The correct login user should be returned now and directory page content can be customized.