AnsweredAssumed Answered

Arcgis server SOE for filtering service based on user

Question asked by geopapadakis on Oct 14, 2014
Latest reply on Oct 15, 2014 by ciava.at

Suppose that i have a service based on a oracle spatial table. The table has an attribute with the username that has access rights to the specific row.

So when i hit the service through the javascript api i'd like the data to be filtered on the tokens username. I figured out how i can get the username inside the SOE using the following

 

Guid guid = Marshal.GenerateGuidForType(typeof(IServerEnvironment));

UID uid = new UIDClass();

uid.Value = guid.ToString("B");

IEnvironmentManager environmentManager = new EnvironmentManager() as IEnvironmentManager;

IServerEnvironment2 serverEnvironment = environmentManager.GetEnvironment(uid) as IServerEnvironment2;


string
userName = serverEnvironment.UserInfo.Name;


IEnumBSTR
roles = serverEnvironment.UserInfo.Roles;

string role = roles.Next();

do

  role = roles.Next(); 

  while

(role != null);

 

So how can i proceed in order to filter the data on the service

 

Thanks

George

Outcomes