Select to view content in your preferred language

Update Level not working

686
1
03-04-2020 07:34 PM
ChrisPedrezuela1
Emerging Contributor

Trying to bump down a level 2 user to level 1. I am an administrator in our on-premise Portal. When I apply the "update_level" to a user I get the error below,

You do not have permissions to access this resource or perform this operation.
---------------------------------------------------------------------------RuntimeError                              Traceback (most recent call last)<ipython-input-5-be7e1c3f4bdd> in <module>()----> 1 uq.update_level('1')C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in update_level(self, level)   4771         if 'roleId' in self and \   4772            self['roleId'] != 'iAAAAAAAAAAAAAAA':-> 4773             self.update_role('iAAAAAAAAAAAAAAA')   4774             self._hydrated = False   4775             self._hydrate()C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in update_role(self, role)   5156         if isinstance(role, Role):   5157             role = role.role_id-> 5158         passed = self._portal.update_user_role(self._user_id, role)   5159         if passed:   5160             self._hydrate()C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\portalpy.py in update_user_role(self, username, role)   1981         postdata = self._postdata()   1982         postdata.update({'user': username, 'role': role})-> 1983         resp = self.con.post('portals/self/updateuserrole', postdata, ssl=True)   1984         if resp:   1985             return resp.get('success')C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in post(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)   1157                                          verify_cert=verify_cert, is_retry=True)   1158 -> 1159                 self._handle_json_error(resp_json['error'], errorcode)   1160                 return None   1161  C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in _handle_json_error(self, error, errorcode)   1178    1179         errormessage = errormessage + "\n(Error Code: " + str(errorcode) +")"-> 1180         raise RuntimeError(errormessage)   1181    1182 class _StrictURLopener(request.FancyURLopener):RuntimeError: You do not have permissions to access this resource or perform this operation. (Error Code: 403)

Does the API not recognizing my Admin role on Portal?

Thanks,
Chris P

Tags (3)
0 Kudos
1 Reply
ChrisPedrezuela1
Emerging Contributor

Seems it was my python installs that have issues. Worked on a machine with clean install and all works.

0 Kudos