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 forrecipientUsername
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()
, andAppendToFile()
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 callingAcceptInvitation()
.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:
- The given
filename
does not exist in the personal file namespace of the caller.- The given
recipientUsername
does not exist.- 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)
- All Sharing and Revocation requirements.