SharePoint Online Deny Permission when uploading Custom MasterPage
In order to customise a SharePoint Online Site you are likely going to need to upload a custom MasterPage, WebPart, Theme etc. For SharePoint On-Prem this is not an issue, but on SharePoint Online there is a default restriction which denies you access to upload to the Web Designer Galleries. If you are unable to see some of these galleries or unable to upload files to these galleries you will see the following message under your permissions in the Library Permissions. This is a Deny Permission.
This can be resolved with O365 Admin rights as detailed below.
If the issue isn’t urgent follow these steps under the ‘Office 365 Admin Settings’ section. If the resolution is urgent follow the steps under the ‘SharePoint Online Management Shell’.
Office365 Admin Settings
1. Login to Office 365 with Admin rights and navigate to the O365 Admin Screen.2. Select SharePoint from the Left Navigation3. Select Settings from the Left navigation4. Scroll down to the Custom Script section and change both Radio Buttons to the second option ‘Allow users to run custom script…’
5. Note the message which states it can take up to 24 hours for this to take effect. For a quicker solution see section below.
SharePoint Online Management Shell
The first thing you’ll need to do here is to download the SharePoint Online Management Shell (link below)
Once installed, run as administrator and follow the steps below:
1. First you need to connect to the O365 SharePoint site using the Connect-SPOService command (example below)
Connect-SPOService -Url https://<yoursite>-admin.sharepoint.com -credential firstname.lastname@example.org
2. When you run the above command you will receive a credentials popup window to add your password for the admin account
3. Once you’ve submitted your password you’ll be connected. Then all you need to do is run the Set-SPOSite command to set the DenyAddCustomPages to false:
Set-SPOSite -Identity https://<yourdomain>.sharepoint.com -DenyAddAndCustomizePages $false
4. This will take immediate effect and you will see any hidden Web Designer Gallery links and have the appropriate rights to add custom Master Pages etc.