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

5.6 User.CreateInvitation


CreateInvitation(filename string, recipientUsername string) (invitationPtr UUID, err error)

Given a filename in the personal namespace of the caller, this function creates a secure file share invitation that contains all of the information required for recipientUsername to take the actions detailed in Sharing and Revoking on the corresponding file.

The returned invitationPtr must be the UUID storage key at which the secure file share invitation is stored in the Datastore.

You should assume that, after this function is called, the recipient receives a notification via a secure communication channel that is separate from your client. This notification includes the invitationPtr and the username of the caller who created the invitation.

Note that the first parameter to the StoreFile(), LoadFile(), and AppendToFile() functions in the client API is a filename in the caller’s personal namespace. The recipient will not have a name for the shared file in their personal namespace until they accept the invitation by calling AcceptInvitation().

You may assume this function will not be called on a recipient who is already currently authorized to access the file (see Sharing and Revoking).

Returns an error if:

  1. The given filename does not exist in the personal file namespace of the caller.
  2. The given recipientUsername does not exist.
  3. Sharing cannot complete due to any malicious action.

Parameters

filename (string) - the name of the file to share with the recipient
recipient (string) - the username of the user with whom the file should be shared

Return

invitationPtr (UUID), err (error)


Do not forget that your design must satisfy all requirements, including: