Skip to main content Link Search Menu Expand Document (external link)

5.8 User.RevokeAccess


RevokeAccess(filename string, recipientUsername string) (err error)

Given a filename in the personal namespace of the caller, this function revokes access to the corresponding file from recipientUsername and any other users with whom recipientUsernamehas shared the file.

A revoked user must lose access to the corresponding file regardless of whether their invitation state is created or accepted.

The client MUST prevent any revoked user from using the client API to take any action on the file. However, recall from Threat Model that a revoked user may become malicious and use the Datastore API directly (see Sharing and Revoking).

After revocation, the client MUST return an error if the revoked user attempts to take action through the Client API on the file, with one exception: the case in which a user calls StoreFile on a file that has been revoked is undefined behavior and will not be tested.

You may assume this function will only be called by the file owner on recipients with whom they directly shared the file (see Sharing and Revoking).

Returns an error if:

  1. The given filename does not exist in the caller’s personal file namespace.
  2. The given filename is not currently shared with recipientUsername.
  3. Revocation cannot complete due to malicious action.

Parameters

filename (string) - the name of the file in the caller’s personal file namespace
recipientUsername (string) - username of the user to revoke access from

Return

err (error)


Do not forget that your design must satisfy all requirements, including:
  • All Sharing and Revoking requirements.