I came across an issue in an Office 365 tenancy where SharePoint – Site Collection Admins were getting “Access Denied” errors when they tried to work with assets in the Master Page gallery.
- Open SharePoint Online Management Shell with Administrative rights
- run: Connect-SPOService https://tenant-admin.sharepoint.com (change tenant with your URL)
- Get-SPOSite -Identity “https://tenant.sharepoint.com” | fl *
- DenyAddAndCustomizePages should be Disabled, in order to disable it run the following command
- Set-SPOSite -Identity “https://tenant.sharepoint.com” -DenyAddAndCustomizePages $false