コード例 #1
0
ファイル: views.py プロジェクト: pwilkins/nbproject
def delete_file(P, req): 
    #this method is used to rename both files and folders. 
    uid = UR.getUserId(req)
    f_auth = auth.canDeleteFile if P["item_type"]=="file" else auth.canDeleteFolder
    if not f_auth(uid, P["id"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    return UR.prepare_response({"id": annotations.delete_file(uid, P)}) #special form since file isn't in there anymore
コード例 #2
0
def delete_file(P, req): 
    #this method is used to rename both files and folders. 
    uid = UR.getUserId(req)
    f_auth = auth.canDeleteFile if P["item_type"]=="file" else auth.canDeleteFolder
    if not f_auth(uid, P["id"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    return UR.prepare_response({"id": annotations.delete_file(uid, P)}) #special form since file isn't in there anymore
コード例 #3
0
ファイル: views.py プロジェクト: computercolin/nbproject
def delete_file(P, req): 
    uid = UR.getUserId(req)
    if not auth.canDeleteFile(uid, P["id"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    return UR.prepare_response({"id": annotations.delete_file(uid, P)}) #special form since file isn't in there anymore
コード例 #4
0
ファイル: views.py プロジェクト: sdcgreene/nbproject
def delete_file(P, req):
    uid = UR.getUserId(req)
    if not auth.canDeleteFile(uid, P["id"]):
        return UR.prepare_response({}, 1, "NOT ALLOWED")
    return UR.prepare_response({"id": annotations.delete_file(
        uid, P)})  #special form since file isn't in there anymore