Select to view content in your preferred language

Copying favorites from one user to another

946
4
03-28-2019 08:15 AM
SeanSweeney
Regular Contributor

I'm trying to move users from ArcGIS online logins to SSO logins, and one thing I stuck on is favorites.  I can get the list of favorites from the old user using the favGroupId but when I try hen I try to add them to the new user by sharing them to the favGroupId (the way I would with any other group), I just get 'notSharedWith' for all the items.

favs = gis.groups.get(olduser.favGroupId)
for fav in favs.content():
    print(fav.share(groups=newuser.favGroupId))
# Full item and group IDs edited out
{'notSharedWith': ['94..aa'], 'itemId': 'b4..34'}
{'notSharedWith': ['94..aa'], 'itemId': 'a5..77'}
{'notSharedWith': ['94..aa'], 'itemId': '64..35'}‍‍‍‍‍‍‍

Is there another way to do this?

Tags (1)
0 Kudos
4 Replies
SeanSweeney
Regular Contributor

It turns out the above code works fine as long as I'm logged in to the gis as the newuser, however that doesn't work for me in this scenario because I can't log in as the target SSO users.

It does not work if I'm just logged in as an admin (which is what I tried above).

I'm still looking for another option.

0 Kudos
TristanMcHardie
Regular Contributor

Hi @SeanSweeney, I'm in a similar situation 3.5 years later. Did you figure this one out?

0 Kudos
Sean-Sweeney
Occasional Contributor

Hi @TristanMcHardie,

Sadly, I never did figure this one out. I ended up just sending each user a list of their favorites to re-add themselves, which was painful for everyone.

Since this was a one-time thing for us, I never went back to see if anything was ever added to the API for this.

I'm sorry I can't be more help and I hope you can find a better solution.

Regards,

Sean Sweeney

TristanMcHardie
Regular Contributor

Thanks for replying so quickly! Yes, that's what I've ended up doing as well - sending an email with a list of items. As you say, a one-time thing, so not worth delving further into.

Thanks again,

Tristan

0 Kudos