SharePoint Online Access Denied in MasterPage Gallery

We came across an issue today in an Office 365 tenancy where Site Collection Admins were getting “Access Denied” errors when they tried to work with assets in the MasterPage gallery. This was happening for any Site Collection administrator.

Tracked the issue to this to a line in the “check permissions” that was explicitly denying these users for “Adding or Customizing Pages” in that library.

After a barrage of googling we found a whole whack of Office 365 support posts where Microsoft Support had indicated that the following SharePoint setting needed to be changed in the “SharePoint Admin” area of the Office 365 Admin Portal.

Looking at a number of our clients they all had this set to allow, but the one client where we were experiencing the issue it was set to Prevent. This was a fairly new tenancy and they had not changed that configuration value.

This needs to be switched to “Allow” and let bake for at least 24 hours, although our suspicion will be that it will be longer. There doesn’t seem to be too much info as to why this causes the issue above, but it does appear to be the solution.