-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArcGIS API for Python SharingGroupManager Limitations? #2180
Comments
@theisenm12 Thanks for finding this! It is a bug. For now you can used the |
@nanaeaubry I found that this was also happening with other Item types as well. I will try to replace it with the shared_with function. Where would I replace "shared_with" in the script to theoretically make it work as a start? I thought that method was deprecated. |
@theisenm12 Deprecated means it will be removed in a later version, not that it doesn't work anymore. You can use it as a workaround for now and we will put a fix in for the other method |
@nanaeaubry I replaced "groups = item.sharing.groups.list()" with "groups = item.shared_with()" and am getting the following error. Any thoughts? Should I use an older version than v10.0? /tmp/ipykernel_36/2597715065.py:22: DeprecatedWarning: shared_with is deprecated as of 2.3.0.1 and has be removed in 3.0.0. Use TypeError Traceback (most recent call last) TypeError: 'dict' object is not callable |
@theisenm12 That's because it's a property: |
@nanaeaubry Ope, good call. I changed it to item.sharing.shared_with["groups"]. The script ran well and populated my table, however, it looks like the number of groups it called is still capped at 5. Is this potentially the same issue as the .sharing property? Or were you able to get .shared_with to produce more than 5? |
@theisenm12 Hmm no with |
@nanaeaubry Weird. I have a custom role but it essentially gives me the same permissions as admin. We also just tested the script with my coworker who is an admin and got the same results. Even using the following code snippet, I am still only getting 5 groups returned for specific item ID's. access the content item as an item objectitem = gis.content.get("xyz") item object -> SharingManager (.sharing)SharingManager -> SharingGroupManager (.groups)SharingGroupManager list() methodfor group_obj in item.sharing.shared_with["groups"]: |
@nanaeaubry Could you share the script using shared_with that you got to return more than 5 groups? Or have you been able to find something in my script that is limiting us to only return 5 groups? Thanks and happy new years! |
@theisenm12 We put a fix in for this issue and it will be in 2.4.1 For the shared_with the code is:
Closing since the issue has been fixed for next release |
I am trying to run a script that loops through my AGOL organizations documents (Microsoft Excel, Word and Powerpoint items) and return how many groups they are shared with in a table export. I have noticed that no matter how many groups an item is shared with, it caps at 5 groups in table. Does anyone know of any limitations on this function? Code below.
error:
The code runs successfully, but does not grab all the groups. I thought it might be a character limit issue but when running some debugging scripts, The for loop that cycles through each item and reads the shared groups was only picking up 5 groups for items that were shared with many more than that. I am wondering if I don't need to paginate somewhere in here, but I am not sure how I would go about that.
The text was updated successfully, but these errors were encountered: