cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingworxStorage the logger user different than Resources CurrentSessionInfo GetCurrentUser

Highlighted

ThingworxStorage the logger user different than Resources CurrentSessionInfo GetCurrentUser

In ThingworxStorage logs the logger user is different than the user returne by Resources["CurrentSessionInfo"].GetCurrentUser();

 

The service I have try to set a property to the user:

 

logger.debug(l"Input->PlantUPL-> " + PlantUPL);
var user = (UserName!=null) ? UserName : Resources["CurrentSessionInfo"].GetCurrentUser();
logger.debug(l "User-> " + user);
Users[UserName].LastPlantUPL = PlantUPL;

 

 

The Script Log shows this error: 

Line 494541: 2019-01-20 16:39:28.331+0000 [L: DEBUG] [O: S.c.t.d.e.DSLScript] [I: ] [U: U529679] [S: ] [T: http-nio-8080-exec-24] User-> u106949
Line 494542: 2019-01-20 16:39:28.332+0000 [L: ERROR] [O: S.c.t.d.e.DSLProcessor] [I: ] [U: U529679] [S: ] [T: http-nio-8080-exec-24] User does not have visibility permission for u106949

 

 

Somehow user U529679 is in the logs but u106949 is the current user in the Resource. 

2 REPLIES 2

Re: ThingworxStorage the logger user different than Resources CurrentSessionInfo GetCurrentUser

Hello.

This article might be relevant. It looks like the returned string value needs to be typecast to a User type.

 

Try something like:

 

var currentUser = Resources["CurrentSessionInfo"].GetCurrentUser();
var result = Users[currentUser].property1;

 

Thanks,

-- Craig A.

Re: ThingworxStorage the logger user different than Resources CurrentSessionInfo GetCurrentUser

Hi @vguevaraperez.

 

If the response provided by @CRArko answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon