Skip to content

Commit de7815b

Browse files
[All Hosts] (security) updating permissions articles for unified mani… (#4719)
* [All Hosts] (security) updating permissions articles for unified manifest * small fixes * Apply suggestions from code review Co-authored-by: Sam Ramon <[email protected]> * Update docs/develop/requesting-permissions-for-api-use-in-content-and-task-pane-add-ins.md * add column for app-specific APIs * add host support note * Update unified-manifest-support-note.md * metadata date --------- Co-authored-by: Sam Ramon <[email protected]>
1 parent f6a1d71 commit de7815b

File tree

3 files changed

+107
-43
lines changed

3 files changed

+107
-43
lines changed

docs/concepts/privacy-and-security.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Privacy and security for Office Add-ins
33
description: Learn about the privacy and security aspects of the Office Add-ins platform.
4-
ms.date: 05/16/2024
4+
ms.date: 02/12/2025
55
ms.localizationpriority: medium
66
---
77

@@ -129,13 +129,37 @@ Follow these general guidelines to support the security model of Office Add-ins,
129129

130130
### Request the necessary permissions
131131

132-
The add-in platform provides a permissions model that your add-in uses to declare the level of access to a user's data that it requires for its features. Each permission level corresponds to the subset of the JavaScript API for Office your add-in is allowed to use for its features. For example, the **WriteDocument** permission for content and task pane add-ins allows access to the [Document.setSelectedDataAsync](/javascript/api/office/office.document) method that lets an add-in write to the user's document, but doesn't allow access to any of the methods for reading data from the document. This permission level makes sense for add-ins that only need to write to a document, such as an add-in where the user can query for data to insert into their document.
132+
The add-in platform provides a permissions model that your add-in uses to declare the level of access to a user's data that it requires for its features. Each permission level corresponds to the subset of the JavaScript API for Office your add-in is allowed to use for its features. For example, the **write document** permission for content and task pane add-ins allows access to the [Document.setSelectedDataAsync](/javascript/api/office/office.document) method that lets an add-in write to the user's document, but doesn't allow access to any of the methods for reading data from the document. This permission level makes sense for add-ins that only need to write to a document, such as an add-in where the user can query for data to insert into their document.
133133

134-
As a best practice, you should request permissions based on the principle of *least privilege*. That is, you should request permission to access only the minimum subset of the API that your add-in requires to function correctly. For example, if your add-in needs only to read data in a user's document for its features, you should request no more than the **ReadDocument** permission. (But, keep in mind that requesting insufficient permissions will result in the add-in platform blocking your add-in's use of some APIs and will generate errors at run time.)
134+
As a best practice, you should request permissions based on the principle of *least privilege*. That is, you should request permission to access only the minimum subset of the API that your add-in requires to function correctly. For example, if your add-in needs only to read data in a user's document for its features, you should request no more than the **read document** permission. (But, keep in mind that requesting insufficient permissions will result in the add-in platform blocking your add-in's use of some APIs and will generate errors at run time.)
135135

136-
You specify permissions in the manifest of your add-in, as shown in the example in this section below, and end users can see the requested permission level of an add-in before they decide to install or activate the add-in for the first time. Additionally, Outlook add-ins that request the **ReadWriteMailbox** permission require explicit administrator privilege to install.
136+
You specify permissions in the manifest of your add-in, as shown in the example in this section below, and end users can see the requested permission level of an add-in before they decide to install or activate the add-in for the first time. Additionally, Outlook add-ins that request the **read/write mailbox** permission require explicit administrator privilege to install.
137137

138-
The following example shows how a task pane add-in specifies the **ReadDocument** permission in its manifest. To keep permissions as the focus, other elements in the manifest aren't displayed.
138+
To see an example of how to request permissions in the manifest, open the tab for the type of manifest your add-in uses.
139+
140+
# [Unified manifest for Microsoft 365](#tab/jsonmanifest)
141+
142+
[!include[Unified manifest host application support note](../includes/unified-manifest-support-note.md)]
143+
144+
The following example shows how a task pane add-in specifies the **read document** permission in its manifest. To keep permissions as the focus, other elements in the manifest aren't displayed.
145+
146+
```json
147+
"authorization": {
148+
"permissions": {
149+
"resourceSpecific": [
150+
...
151+
{
152+
"name": "Document.Read.User",
153+
"type": "Delegated"
154+
},
155+
]
156+
}
157+
}
158+
```
159+
160+
# [Add-in only manifest](#tab/xmlmanifest)
161+
162+
The following example shows how a task pane add-in specifies the **read document** permission in its manifest. To keep permissions as the focus, other elements in the manifest aren't displayed.
139163

140164
```xml
141165
<?xml version="1.0" encoding="utf-8"?>
@@ -144,12 +168,14 @@ The following example shows how a task pane add-in specifies the **ReadDocument*
144168
xmlns:ver="http://schemas.microsoft.com/office/appforoffice/1.0"
145169
xsi:type="TaskPaneApp">
146170

147-
... <!-- To keep permissions as the focus, not displaying other elements. -->
148-
<Permissions>ReadDocument</Permissions>
149-
...
171+
... <!-- To keep permissions as the focus, not displaying other elements. -->
172+
<Permissions>ReadDocument</Permissions>
173+
...
150174
</OfficeApp>
151175
```
152176

177+
---
178+
153179
For more information about permissions for task pane and content add-ins, see [Requesting permissions for API use in add-ins](../develop/requesting-permissions-for-api-use-in-content-and-task-pane-add-ins.md).
154180

155181
For more information about permissions for Outlook add-ins, see the following topics.

0 commit comments

Comments
 (0)