Access denied while refreshing all published content types on next update

Working with the Content Type Hub and publish (syndicate) content types to other site collections; have you received an Access Denied message when selecting the “Refresh all published content types on next update”?

Well it turns out that you are denied access because the DenyAddAndCustomizePages is set to TRUE for that site collection.

To grant access to the “Refresh all published content types on next update” functionality you need to set the “Deny Add and Customize Pages” fag to false. This can be done simply, by running the following PowerShell:

Connect-SPOService https://tenant-admin.sharepoint.com;
Set-SPOsite https://tenant.sharepoint.com/sites/example -DenyAddAndCustomizePages 0;
Disconnect-SPOService;