SharePoint Online APIs - detect NoScript (DenyAddAndCustomizePages) state?

109 Views Asked by At

I'm attempting to query for properties of a SharePoint Online site using the _api method in a SharePoint Framework TypeScript project (https://tenancy.sharepoint.com/sites/classic-example/_api/site) and determine if the site is a NoScript site or not. The goal is to eventually write a User Custom Action to a site if it's supported.

Currently I can only seem to detect if custom scripting is allowed by attempting to write a UCA, and getting an undefined result using PNP JS https://pnp.github.io/pnpjs/sp/user-custom-actions/ add() method.
But this would occur if the user also did not have permissions.

I'm hoping to detect if a site allows it vs. the user simply doesn't have permission.

The code in question will not be running on the site that is being checked. It's a web part checking other sites in the environment.

0

There are 0 best solutions below