Office.MailboxEnums.DelegatePermissions enum

This bitmask represents a delegate's permissions on a shared folder, or a user's permissions on a shared mailbox.

Remarks

[ API set: Mailbox 1.8 ]

Applicable Outlook mode: Compose or Read

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/65-delegates-and-shared-folders/get-shared-properties.yaml

if (!Office.context.mailbox.item.getSharedPropertiesAsync) {
  console.error("Try this sample on an appointment from a shared folder.");
  return;
}

Office.context.mailbox.getCallbackTokenAsync({ isRest: true }, function(result) {
  if (result.status === Office.AsyncResultStatus.Succeeded && result.value !== "") {
    Office.context.mailbox.item.getSharedPropertiesAsync(
      {
        // Pass auth token along.
        asyncContext: result.value
      },
      function(result2) {
        let sharedProperties = result2.value;
        let delegatePermissions = sharedProperties.delegatePermissions;

        // Determine if user has the appropriate permission to do the operation.
        if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Read) != 0) {
          const ewsId = Office.context.mailbox.item.itemId;
          const restId = Office.context.mailbox.convertToRestId(ewsId, Office.MailboxEnums.RestVersion.v2_0);
          let rest_url =
            sharedProperties.targetRestUrl + "/v2.0/users/" + sharedProperties.targetMailbox + "/events/" + restId;

          $.ajax({
            url: rest_url,
            dataType: "json",
            headers: { Authorization: "Bearer " + result2.asyncContext }
          })
            .done(function(response) {
              console.log(response);
            })
            .fail(function(error) {
              console.error(error);
            });
        }
      }
    );
  }
});

Fields

Read = 1

Delegate or user has permission to read items.

Write = 2

Delegate or user has permission to create and write items.

DeleteOwn = 4

Delegate or user has permission to delete only the items they created.

DeleteAll = 8

Delegate or user has permission to delete any items.

EditOwn = 16

Delegate or user has permission to edit only they items they created.

EditAll = 32

Delegate or user has permission to edit any items.