2.3.2.3. RevokeFile
Implement this function:
- User.revoke_file(filename: str, old_recipient: str)
Revokes
old_recipient’s access tofilenamesuch thatold_recipientis no longer able to read, modify, or sharefilenamewith other users. However, raises autil.DropboxErrorin the following circumstances:If the calling user is not the owner of the file named
filename.Permission revocation cannot complete due to malicious action.
Notes:
Revocation specifically means that
old_recipientno longer has access to any updates made to the file after theold_recipient‘s access was revoked. Thus, your implementation may (but does not have to) allowold_recipientto still have access to a version of the file before the user’s access was revoked, as long asold_recipientis not able to observe new updates or make updates to the file themselves.
Your implementation may (but does not have to) allow
old_recipientto mount a denial of service attack on the file owner by overwriting the contents offilename. However, the file owner should never acceptold_recipient’s changes tofilenameas valid when downloading the file indownload_file(that is,download_fileshould detect the integrity violation and raise an error).
- param str filename:
The name of the file
- param str old_recipient:
The name of the old recipient to revoke from
- return:
nothing
- raises DropboxError:
if an error case occurred