2.3.2.3. RevokeFile

Implement this function:

User.revoke_file(filename: str, old_recipient: str)

Revokes old_recipient’s access to filename such that old_recipient is no longer able to read, modify, or share filename with other users. However, raises a util.DropboxError in 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_recipient no longer has access to any updates made to the file after the old_recipient‘s access was revoked. Thus, your implementation may (but does not have to) allow old_recipient to still have access to a version of the file before the user’s access was revoked, as long as old_recipient is not able to observe new updates or make updates to the file themselves.

  • Your implementation may (but does not have to) allow old_recipient to mount a denial of service attack on the file owner by overwriting the contents of filename. However, the file owner should never accept old_recipient’s changes to filename as valid when downloading the file in download_file (that is, download_file should 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