def add_folder(payload, req): uid = UR.getUserId(req) id_ensemble = payload["id_ensemble"] id_parent = payload["id_parent"] if not auth.canAddFolder(uid, id_ensemble, id_parent): return UR.prepare_response({}, 1, "NOT ALLOWED") id_folder = annotations.create_folder(id_ensemble, id_parent, payload["name"]) return UR.prepare_response(annotations.get_folders(uid, {"id": id_folder}))