question

sns1 avatar image
0 Votes"
sns1 asked sns1 commented

Access error while adding custom display template

Even through I am global admin and part respective site collection admin, while adding custom display template in the content web part folder in the master page section coming up with below error. Please help
127224-accesserror.png


office-sharepoint-online
accesserror.png (90.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered sns1 commented

@sns1

Please follow below tips to troubleshoot the issue.

1.Check the Master Page Gallery whether has unique permission. Also check your permission in the Master Page Gallery.

2.It may be caused by that Custom Script is disabled in the SharePoint Online for security reasons by default.

You should enable Custom Script to resolve this issue.

(1)Go to SharePoint admin center (https://<tenant>-admin.sharepoint.com) -> Click Settings in the left navigation -> Scroll down to “Custom Script” section -> In the Custom Script section, Set “Allow users to run custom script on personal site” and “Allow users to run custom script on self-service created sites” options.

However, this change may take up to 24 hours to reflect. To enable Custom Script in a particular site collection immediately, please use following PowerShell through SharePoint Online Management Shell.

(2)PowerShell.

 $AdminSiteURL="https://crescent-admin.sharepoint.com"
 $SiteURL="https://crescent.sharepoint.com"
           
 $Cred = Get-Credential
           
 Connect-SPOService -URL $AdminSiteURL -Credential $Cred
           
 Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False

Reference:
Allow or prevent custom script


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Emily Du,

Thank you, It is because of custom script disabled, I have enabled it , it worked.

0 Votes 0 ·