Member-only story
App Permissions in SharePoint
Setting app permissions in SharePoint is a critical aspect of developing custom applications and add-ins. By using the AppPermissionRequests element, developers can define the necessary access levels required for their apps to function optimally without compromising security.
Understanding AppPermissionRequests
AppPermissionRequests is an XML element used in SharePoint to define the permissions required by an app to function correctly within the SharePoint environment.
The syntax of the AppPermissionRequests element consists of one or more AppPermissionRequest elements. Each AppPermissionRequest element defines a specific scope and the corresponding rights that the app should have within that scope.
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/taxonomy" Right="Write" />
<AppPermissionRequest Scope="http://sharepoint/search" Right="QueryAsUserIgnoreAppPrincipal" />
</AppPermissionRequests>
Let’s break down the example provided:
AllowAppOnlyPolicy="true"
This attribute allows the app to act with app-only permissions, meaning the app will not…