Hey everyone,
I am working on a larger notebook but have ran into a stumbling block. Basically, the end result of the notebook is to check the sharing level of all layers in a webmap and see what layers are shared publicly OR shared to a specific group; in this case, the group is called "NSARGC 3 SARCOP Partnered Collaboration Internal Group - 41484b". I figured out the public sharing part but haven't been able to figure out the group sharing in line 8. For ease of reading, I simplified the script to print "Shared Correctly" or "Not Shared Correctly" since I can get the script to run from there. Does anyone have any ideas on how to look at a specific group? Thanks!
wm=WebMap(webmap_item)
for lyr in wm.layers:
if "itemId" in lyr:
lyr_item = gis.content.get(lyr.itemId)
print(f"Layer {lyr.title} sharing: {lyr_item.shared_with}")
if lyr_item.shared_with['everyone'] is True:
print("Shared Publicly")
if lyr_item.shared_with["NSARGC 3 SARCOP Partnered Collaboration Internal Group - 41484b"] is True:
print("Shared to group")
else:
print("Not Shared Correctly")