Portal Organization Items

354
1
01-13-2018 04:45 PM
WorthSparks
New Contributor III

My app is logging in with a named user so I have a portal and a user (AGSPortal and AGSPortalUser). I want to list for the user all the web maps he or she has access to within their organization but not all the publicly available web maps out there. Here is what I've figured out:

  • user.fetchContent - gets the user's own items
  • portal.findItems(with: AGSPortalQueryParameters) - get all items meeting query, including freely open and available items.

Is there a way to configure AGSPortalQueryParameters to return only all the items the user has access to in the organization? Or even better, is there a direct way to get the organization items?

0 Kudos
1 Reply
Nicholas-Furness
Esri Regular Contributor

Take a look at the search parameters here. You should be able to use either the access property or the orgid term to build an AGSPortalQueryParameters using queryParametersWithQuery() to pass to the portal.findItems() call.

If you use orgid, you can get it from portal.portalInfo.organizationID.

Also, since this could return a lot of items, consider paging through the results.

Let me know how that goes!