c# - AX 2012 R3 AIF System Services Callcontext of another user -


is possible call aif system services using callcontext of user? need fetch tables user has access to. using method getaccessrights in usersessionservice, can extract tables have access to. need call other users, tried setting callcontext.logonasuser user, error:

an unhandled exception of type 'system.servicemodel.faultexception' occurred in mscorlib.dll

additional information: failed logon microsoft dynamics ax.

to able use logonasuser on custom services, need set "trusted intermediary users" on inbound port. however, doesn't seem possible set on system services.

i'm testing on contoso image. i'm logged in contoso\administrator.

the complete code:

ussreference.usersessionserviceclient client = new ussreference.usersessionserviceclient();  ussreference.callcontext context = new ussreference.callcontext {     logonasuser = "vishwar" };  ussreference.accesscontrolleditemkey key = new ussreference.accesscontrolleditemkey(); key.itemtype = ussreference.accesscontrolledtype.table; key.itemname = "custtable";  userservice.ussreference.accessright[] rights = client.getaccessrights(context, new ussreference.accesscontrolleditemkey[] { key }); 

you can create custom aif inbound port , add aifusersessionservice.getaccessrights operation. here can set allow trusted intermediary impersonate.

custom aif service operation


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -