def api_role(request, appname, username): if request.method == 'GET': status_code, view_object, msg, url = MaintainApi.get_role( appname, username=username) return render_json_response(status_code, 'role', view_object, msg, url) else: return _invalid_request_method('role', request.method)
def api_roles_get(request, appname): access_token = request.META.get('HTTP_ACCESS_TOKEN', 'unknown') status_code, view_object, msg, url = MaintainApi.get_role( appname, access_token=access_token) return render_json_response(status_code, 'role', view_object, msg, url)