Using ArcGIS Enterprise 10.5, is it possible to write a script to change named users from Level 2 users to Level 1 users? I looked at the ArcGIS Python API and while it appears you can do a number of things, including changing the role, I did not see any mention of changing the level in the documentation.
Thanks!
Mike Sweeney
If you can do it through the UI, you can do it through Python. Taking a look at the network traffic, it looks like it updates the user level by using the following URL and parameters:
https://<portal_host>/<context>/sharing/rest/portals/self/updateUserLevel and passes the following parameters:
{
"user": "<user_name>",
"level": "<new_level>",
"f": "json",
"token": "<token>"
}
Then, it updates the user to be an appropriate role for the new level:
https://<portal_host>/<context>/sharing/rest/portals/self/updateUserRole
{
"user": "<user_name>",
"role": "<new_role>",
"f": "json",
"token": "<token>"
}
I'm not too sure if it's been included in the documentation or the Python API itself, though.
Is this only for Portal? Will it work for AGOL?
I believe the URLs above will only work for Portal, but the same concept applies; perform your operation in ArcGIS Online with Fiddler or the Dev Tools open to capture the traffic, and then recreate the request using Python.