Cannot Unshare Item

754
3
12-18-2018 09:17 AM
IsaiahAguilera
Occasional Contributor II

I am using a script to recursivly unshare all items in an AGOL users content and I am using item.share(False, False, None, False). However after it runs the sharing on the item remains shared everyone true. Any ideas? It seems to be having trouble with items shared everyone. 

Tags (3)
3 Replies
IsaiahAguilera
Occasional Contributor II

Anybody? This has to be a bug. Unless I am missing something huge.

0 Kudos
by Anonymous User
Not applicable

I also have this question. I am trying to unshare an item so that is completely private. I have tried using the following to no avail:

item.share(everyone=False, org=False, groups=None, allow_members_to_edit=False)
item.share(everyone=False, org=False, groups=[], allow_members_to_edit=False)
item.share(everyone=False, org=False, groups=None, allow_members_to_edit=True)
item.share()
item.share(False)

None of these affected what groups the item is shared with.

0 Kudos
by Anonymous User
Not applicable

Isaiah Aguilera

Figured it out. You have to use the item.unshare() method, which requires a list of groups for the item to be unshared with.

0 Kudos