You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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]>
Copy file name to clipboardExpand all lines: docs/concepts/privacy-and-security.md
+34-8Lines changed: 34 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Privacy and security for Office Add-ins
3
3
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
5
5
ms.localizationpriority: medium
6
6
---
7
7
@@ -129,13 +129,37 @@ Follow these general guidelines to support the security model of Office Add-ins,
129
129
130
130
### Request the necessary permissions
131
131
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.
133
133
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.)
135
135
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.
137
137
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.
139
163
140
164
```xml
141
165
<?xml version="1.0" encoding="utf-8"?>
@@ -144,12 +168,14 @@ The following example shows how a task pane add-in specifies the **ReadDocument*
... <!-- 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
+
...
150
174
</OfficeApp>
151
175
```
152
176
177
+
---
178
+
153
179
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).
154
180
155
181
For more information about permissions for Outlook add-ins, see the following topics.
0 commit comments