Skip to main content
15-Moonstone
June 7, 2023
Solved

How to fetch which user has access to which thing in an info table in thingworx

  • June 7, 2023
  • 1 reply
  • 1927 views

Hi all,

 

How to fetch which user has access to which thing in an info table!

 

Thank you

 

Best answer by MM_9023322

Hi @jensc @PaiChung,

 

I used the nested loop!

  •  First listed the things 
  • Applied loop to read 1 by 1 thing
  • Used getRunTimePermission on that thing to get the user info
  • Created info table with the information

This way I was able to achieve the requirements!

 

Thank you for your support!

1 reply

22-Sapphire I
June 7, 2023

I think your best bet is maybe this: https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Composer/Security/Users/AccessReports.html#

The other way, for a Thing, you can pull Visiblity/Permission info I think, which would give you Users and User Groups and you'd have to then determine who are in the User Groups.

Potentially it may not capture Collection level settings, or even inherited permissions 😞

17-Peridot
June 8, 2023

Hello @PaiChung,

 

There still isn't any way to use the Access Report through some API right?

 

I built my own kind of access report @MM_9023322 using the way PaiChung suggests. Getting all entities in a project and checking the visibility, runtime and design time permissions on each entitiy against a specific username or getting who has permissions for a specific thing.

 

Perhaps I did it in a roundabout way, but I felt it wasn't very performant as I had to do nested loops to get all of the information.

 

Regards,

Jens

22-Sapphire I
June 8, 2023

The access report itself is based on 'Services' ie API calls.

Just have to discover which ones they are, you should be able to see them using the developer tools.