def workspaceGET(): ''' ''' ###TODO - should whoami redirect to a login page? ### yes the client should only expect to handle HTTP CODES ### compare on userID identity = model.whoami() if not identity: json_dirlist = json.dumps([]) else: w = security.WorkSpace(identity.userID) json_dirlist = json.dumps(w.annotatedfiles) resp = flask.make_response(json_dirlist) resp.content_type='application/json' resp.headers["Access-Control-Allow-Origin"]= "*" model.callstatsd('rhaptos2.e2repo.workspace.GET') return resp
def before_request(): g.user = model.whoami()