2.3.2.3. RevokeFile
Implement this function:
- User.revoke_file(filename: str, old_recipient: str)
Revokes
old_recipient
’s access tofilename
such thatold_recipient
is no longer able to read, modify, or sharefilename
with other users. However, raises autil.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 theold_recipient
‘s access was revoked. Thus, your implementation may (but does not have to) allowold_recipient
to still have access to a version of the file before the user’s access was revoked, as long asold_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 offilename
. However, the file owner should never acceptold_recipient
’s changes tofilename
as valid when downloading the file indownload_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