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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

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

MM_9023322
14-Alexandrite

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

Hi all,

 

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

 

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
MM_9023322
14-Alexandrite
(To:jensc)

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!

View solution in original post

6 REPLIES 6
PaiChung
22-Sapphire I
(To:MM_9023322)

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

jensc
17-Peridot
(To:PaiChung)

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

PaiChung
22-Sapphire I
(To:jensc)

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.

MM_9023322
14-Alexandrite
(To:jensc)

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!

jensc
17-Peridot
(To:MM_9023322)

Great!

 

It is also true as Pai says, my tests showed that the Get"RunTime/DesignTime/Visibility"Permission services does not give you collection permissions. I can't recall if it showed inherited permissions though...

 

I think there are specific services to get both collection and inherited permissions, so you could probably use those to get the rest of your permissions.

 

Good luck!

 

Regards,

Jens

 

PaiChung
22-Sapphire I
(To:MM_9023322)

Just one additional note, if you ever need to get User Permissions based on the user that is logged in, those are available in the 'CurrentSession' services.

Top Tags