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

Is there an existing programmatic way to find objects by owner?

Highlighted
Newbie

Is there an existing programmatic way to find objects by owner?

In Thingworx 7.2, I would like to find all objects owned by a particular user.

I see that I can use SpotlightSearch to find all objects of a particular type and then use an InfoTable filter to filter by owner.

However, is there a more direct way to do this that woud reduce the response payload from the server to only objects owned by the specified user without post filtering?

Thanks for any feedback,

Gordon Fleming

Tags (2)
6 REPLIES 6
Highlighted

Re: Is there an existing programmatic way to find objects by owner?

Hi Gordon,

What's owner, a custom property made by you? there's no built in owner concept on TW.

Best Regards,

Carles.

Highlighted

Re: Is there an existing programmatic way to find objects by owner?

Then what does EntityServices  SetOwner service do?

Highlighted

Re: Is there an existing programmatic way to find objects by owner?

I don't know for what purpose it's SetOwner, but clearly it's not easily recoverable this value, as there isn't any GetOwner or alike. I've tested some candidates and neither this information it's inside:

  • GetMetadata
  • GetMetadataWithPermissionsAsJSON
  • GetSummaryInformation
  • GetThingSummaryInformation

Maybe better if you need an "owner" feature, build your own creating a property called "owner" on the things.

Highlighted

Re: Is there an existing programmatic way to find objects by owner?

Actually, what I am attempting to do is delete a user.  I was thinking that I could find all the entities owned by that user and migrate them to another user but as you've stated there does not appear to be a built-in owner concept.  Although, dashboards do have an owner as GetDashboardByTitle only returned dashboards owned by the user invoking GetDashboardByTitle, so it appears at least Dashboards have an owner.

If there is no true concept of owner, then I assume to delete a user I would have to determine if any runtime, or design time permissions reference the user an update them before deleting the user?

Highlighted

Re: Is there an existing programmatic way to find objects by owner?

About searching permissions for a given user, won't be easy either, you will have to crawl everything on your instance, and look at existing permissions and remove it one by one.

And yes, when you delete a user, the permission remains...

Integrity on deletion it's not the best characteristic on TW...

Best Regards,

Carles.

Highlighted

Re: Is there an existing programmatic way to find objects by owner?

If you want to left integrity intact, maybe better to Disable the user instead of deleting it.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!