def request_user_has_role(request, role):
 if (not cfg.CONF.auth.enable):
  return True
 user_db = get_user_db_from_request(request=request)
 return user_has_role(user_db=user_db, role=role)

def request_user_has_role ( request , role ) : if ( not cfg . CONF . auth . enable ) : return True user_db = get_user_db_from_request ( request = request ) return user_has_role ( user_db = user_db , role = role )
check if the logged-in request user has the provided role .