agrc / auditor

A scheduled tool to help keep ArcGIS Online content in compliance with UGRC standards
MIT License
1 stars 0 forks source link

Group Sharing may not be working #45

Closed jacobdadams closed 3 years ago

jacobdadams commented 3 years ago

Auditor is failing to successfully share the new Utah Wilderness layer to the 'Utah SGID Boundaries' group. It will properly share if done manually either through python or the web ui.

Need to debug the code while running the update on that one item to see if all the parameters are correct.

jacobdadams commented 3 years ago

Auditor creates a {name:id} dict by looping through all the groups in the org and getting their title and id:

groups = self.gis.groups.search('title:*')  # pylint: disable=no-member
self.groups_dict = {g.title: g.id for g in groups}

Thus, any groups with duplicate names anywhere in the org can cause Auditor to (try to) share an item with the wrong group, because it relies on text matching f'Utah SGID {the category in the fully-qualified db name}' (SGID.Category.Table) to the dict of names and ids.

I'll open another issue to add a duplicate "Utah SGID {Groupname}" group detector to Auditor.