shared_with failed to get the sharing status

440
2
Jump to solution
09-29-2020 07:48 PM
MinbinJiang
Esri Contributor

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. 

0 Kudos
1 Solution

Accepted Solutions
MinbinJiang
Esri Contributor

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. 

View solution in original post

2 Replies
MehdiPira1
Esri Contributor

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. 

MinbinJiang
Esri Contributor

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.