def update_org_user(userid, orgname=None, profile='grafana', **kwargs):
 if isinstance(profile, string_types):
  profile = __salt__['config.option'](profile)
 if orgname:
  switch_org(orgname, profile)
 response = requests.patch('{0}/api/org/users/{1}'.format(profile['grafana_url'], userid), json=kwargs, auth=_get_auth(profile), headers=_get_headers(profile), timeout=profile.get('grafana_timeout', 3))
 if (response.status_code >= 400):
  response.raise_for_status()
 return response.json()

def update_org_user ( userid , orgname = None , profile = 'grafana' , ** kwargs ) : if isinstance ( profile , string_types ) : profile = __salt__ [ 'config.option' ] ( profile ) if orgname : switch_org ( orgname , profile ) response = requests . patch ( '{0}/api/org/users/{1}' . format ( profile [ 'grafana_url' ] , userid ) , json = kwargs , auth = _get_auth ( profile ) , headers = _get_headers ( profile ) , timeout = profile . get ( 'grafana_timeout' , 3 ) ) if ( response . status_code >= 400 ) : response . raise_for_status ( ) return response . json ( )
update user role in the organization .