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

Visibility issue upon newly adding a user to a user group that has visibility to a thing

Highlighted
Regular Member

Visibility issue upon newly adding a user to a user group that has visibility to a thing

Hello,

 

I am currently trying to implement a service which is executed by a User to move himself to a User Group that has Visibility permissions to a Thing. My Code is as below,

 

try {

   var groupName = "InstrumentUsers" ;
   var params_AddMember = {
      member: username,
      type: "User" /* STRING */
      };
   Groups[groupName].AddMember(params_AddMember);

}


//respond back with the result
result = {
   "success": "true",
   "Instrument": {
     "Alias": Things["Thing"].Alias,  //problem is in this line
     "GUID": "xyz"
  }
};

} catch (err) {
   result = { "success": "false" };
}

 

The "InstrumentUsers" does have the visibility to the "Thing". I also see that the user is properly moved inside the group. The problem arises when the user tries to execute the line Things["Thing"].Alias where he tries to read the property of the Thing. It says the user does not have visibility permission on the "Thing".

Surprisingly, upon executing the service second time, there is no error. I think the issue is that the Twx takes some time to give permission to a user even if he is the rightful group.

I tried pause(), executing some other service before reading the property etc. nothing works for me.

 

Regards,

Vinesh

5 REPLIES 5

Re: Visibility issue upon newly adding a user to a user group that has visibility to a thing

Could you  please try breaking the service into two, first create the one that executes up until the line where it breaks, then second to wrap the first one? If that makes sense.

Re: Visibility issue upon newly adding a user to a user group that has visibility to a thing

Re: Visibility issue upon newly adding a user to a user group that has visibility to a thing

Sorry didn't notice. Was replying to unattended threads

Re: Visibility issue upon newly adding a user to a user group that has visibility to a thing

Sorry.. I had posted that in another forum..Could not delete it,,, If possible could you please delete it?

Re: Visibility issue upon newly adding a user to a user group that has visibility to a thing

Did that too..Doesn't help