Fix "You do not have permission to open this website in SharePoint Designer" Error

Problem: When trying to open a SharePoint Online site in SharePoint Designer, got this error message "You do not have permission to open this website in SharePoint Designer"
You do not have permission to open this web site in sharepoint designer

Solution:
By default, SharePoint designer customization are disabled in modern group sites in SharePoint Online. To enable SharePoint designer, You have to set the "DenyAddAndCustomizePages" flag to False.

PnP PowerShell to Fix "You do not have permission to open this web site in SharePoint Designer"
We can also use PnP PowerShell to enable custom scripting for the SharePoint Online site.
#Parameters
$TenantAdminURL = "https://crescent-admin.sharepoint.com"
$SiteURL = "https://crescent.sharepoint.com/sites/Sales"

#Connect to Tenant Admin
Connect-PnPOnline $TenantAdminURL -UseWebLogin
 
#Enable Custom Script for the Tenant Site
Set-PnPTenantSite -Url $SiteURL -DenyAddAndCustomizePages:$false
This also enables custom scripting for the given SharePoint Online site.

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.