Processing of SharePoint .aspx pages stopped working
Recently we noticed that SharePoint is blocking changes of .aspx page which worked before. After investigation it looks like that on site level Microsoft changed authorizations by including DenyAddAndCustomizePages:
If you tried to make changes in SharePoint .aspx pages and that did not work with error messages in ReplaceMagic AdditionalTab that you do not have enough permissions this is probable root-cause.
Initially, this was weird for us as our main user has Full Control roles (Site Admin Group) but save of .aspx pages did not work.
Solution that we found was to disable this authorization from PowerShell with following code (please replace text in bold with your data):
Option 1 (use in case that Legacy Authentication mode is disabled):
Connect-SPOService -url "https://YOURCOMPANY-admin.sharepoint.com" -Credential $credentials;
$TenantSettings = Get-SPOTenant;
or
Option 2 (you can use it if Legacy Authentication mode is not disabled):
$login = "USERNAME";
$pwd = "PASSWORD";
$pwd = ConvertTo-SecureString $pwd -AsPlainText -Force;
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $login,$pwd;
Connect-SPOService -url "https://YOURCOMPANY-admin.sharepoint.com" -Credential $credentials;
$TenantSettings = Get-SPOTenant;
To check current setting execute:
Get-SPOSite https://your_company.sharepoint.com | select DenyAddAndCustomizePages
If you see:
You will need to disable this authorization by executing:
Set-SPOSite https://your_company.sharepoint.com -DenyAddAndCustomizePages $false;
where after check via Get-SPOSite https://your_company.sharepoint.com | select DenyAddAndCustomizePages now you should see:
Without this change we will not be able to make changes of .aspx pages.
Checking of permissions after this change shows that DenyAddAndCustomizePages is gone: