Hi,
Trying to get the sharing info for portal items with the ArcGIS API for python:
webmap_search = gis.content.search("fdb487b5ee9c46fcac9b57883cce4b8a", item_type="Web Map")
webmap_search[0].shared_with
Always getting result as:
{'everyone': False, 'org': False, 'groups': []}
however, this failed to reflect the real sharing status.
Solved! Go to Solution.
Thanks Mehdi,
The issue seems from the account I was using.
I was using the super admin account of the portal - however, it can't retrieve the sharing groups. I have to switch to the content owner account. I guess there should be somewhere setting to allow the portal admin to do this otherwise doesn't make sense to me as I can't collect all the content own accounts.
The workaround I currently choose is to use the rest api rather than arcgis python API which portal admin works to get this info.
Hi Minbin Jiang,
I can recommend changing the share status of the item manually and rerun the code to see if that gives the same result. The other thing you can do is check other Portal items.
I did a test on items in Portal and it's working fine.
Thanks Mehdi,
The issue seems from the account I was using.
I was using the super admin account of the portal - however, it can't retrieve the sharing groups. I have to switch to the content owner account. I guess there should be somewhere setting to allow the portal admin to do this otherwise doesn't make sense to me as I can't collect all the content own accounts.
The workaround I currently choose is to use the rest api rather than arcgis python API which portal admin works to get this info.