def rename_file(P, req): #this method is used to rename both files and folders. uid = UR.getUserId(req) f_auth = auth.canRenameFile if P["item_type"]=="file" else auth.canRenameFolder if not f_auth(uid, P["id"]): return UR.prepare_response({}, 1, "NOT ALLOWED") return UR.prepare_response({P["item_type"]+"s": annotations.rename_file(uid, P)})
def rename_file(P, req): #this method is used to rename both files and folders. uid = UR.getUserId(req) f_auth = auth.canRenameFile if P["item_type"]=="file" else auth.canRenameFolder if not f_auth(uid, P["id"]): return UR.prepare_response({}, 1, "NOT ALLOWED") return UR.prepare_response({P["item_type"]+"s": annotations.rename_file(uid, P)})
def rename_file(P, req): uid = UR.getUserId(req) if not auth.canRenameFile(uid, P["id"]): return UR.prepare_response({}, 1, "NOT ALLOWED") return UR.prepare_response({"files": annotations.rename_file(uid, P)})
def rename_file(P, req): uid = UR.getUserId(req) if not auth.canRenameFile(uid, P["id"]): return UR.prepare_response({}, 1, "NOT ALLOWED") return UR.prepare_response({"files": annotations.rename_file(uid, P)})