Identify groups with the Shared Update capability

290
3
Jump to solution
03-01-2024 03:29 PM
HeathBrackett1
Occasional Contributor II

I'd like to use the ArcGIS API for Python to identify all of the groups in the organization that have Shared Update capabilities.  The API Reference page says there is a group property of "users_update_items" but it is not recognized as a property when trying to query for it in a script.  I've seen reference of alternate query syntax for querying other properties (like isInvitation in place of is_invitation_only) but cannot find any documentation on how to query for these "special" groups.  Has anybody else had any luck?

Tags (3)
0 Kudos
2 Solutions

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

https://developers.arcgis.com/rest/users-groups-and-items/common-parameters.htm

You can get the group and then check the group capabilities. If the updateitemcontrol capability is returned, it's shared update. If it's not returned, it's not. You'll need to handle it this way - i.e. get capabilities, then if it exists. Not that it's false as it won't be there.

gm=arcgis.gis.GroupManager(myGIS)

myGroup=gm.get("groupID")

myGroup.capabilites

View solution in original post

PeterKnoop
MVP Regular Contributor

As @ChristopherCounsell notes, what you are looking for is a group's capabilities. If you set the parameter users_update_items=True when you create a group, then 'updateitemcontrol' is added to the group's capabilities.

There are other capabilities a group can have, such as "distributed", so you should not rely solely on testing that capabilities is not null. I would recommend explicitly testing that 'updateitemcontrol' is in the group's list of capabilities. 

You can specify a capability as part of your group search query, so one way to retrieve a list of shared update groups is:

shared_udpate_groups = gis.groups.search(
    # A shared update group has 'updateitemcontrol' as one of its capabilites.
    query = 'capabilities:updateitemcontrol', 
    # 10,000 appears to be a hard limit. 
    # If more than 10,000 might be returned, then split up your query and aggregate the results.
    max_groups = 10000    
)

 

View solution in original post

3 Replies
ChristopherCounsell
MVP Regular Contributor

https://developers.arcgis.com/rest/users-groups-and-items/common-parameters.htm

You can get the group and then check the group capabilities. If the updateitemcontrol capability is returned, it's shared update. If it's not returned, it's not. You'll need to handle it this way - i.e. get capabilities, then if it exists. Not that it's false as it won't be there.

gm=arcgis.gis.GroupManager(myGIS)

myGroup=gm.get("groupID")

myGroup.capabilites

PeterKnoop
MVP Regular Contributor

As @ChristopherCounsell notes, what you are looking for is a group's capabilities. If you set the parameter users_update_items=True when you create a group, then 'updateitemcontrol' is added to the group's capabilities.

There are other capabilities a group can have, such as "distributed", so you should not rely solely on testing that capabilities is not null. I would recommend explicitly testing that 'updateitemcontrol' is in the group's list of capabilities. 

You can specify a capability as part of your group search query, so one way to retrieve a list of shared update groups is:

shared_udpate_groups = gis.groups.search(
    # A shared update group has 'updateitemcontrol' as one of its capabilites.
    query = 'capabilities:updateitemcontrol', 
    # 10,000 appears to be a hard limit. 
    # If more than 10,000 might be returned, then split up your query and aggregate the results.
    max_groups = 10000    
)

 

HeathBrackett1
Occasional Contributor II

Thanks gentlemen! That's exactly what I was looking for!

0 Kudos