I'm trying to upload some files to my sites style library folder but I'm getting an error that I don't have permission to do this.

As far as I know I should have all permissions for the full site and I am a site collection administrator.

Any ideas on what I need to do?



Admins list permissons

  • Please check permissions on the Style library, might be unique permissions set to Style library? – Dikesh Gandhi Mar 20 '17 at 12:33
  • 1
    As a site collection administrator permissions, even unique permissions should not get in your way. It's more likely that 1) You don't actually have site collection administrator rights (most common) or 2) there's an active Deny Policy in your farm (rare). – Cornelius J. van Dyk Mar 20 '17 at 12:38
  • @CorneliusJ.vanDyk I have uploaded a screenshot to show. how would I check and solve the other option? – ChrisBull Mar 20 '17 at 13:14
  • @DikeshGandhi I've added a picture to show the permissions on the library – ChrisBull Mar 20 '17 at 13:19

do you have custom scripts enabled in your SharePoint Online settings? http://go.microsoft.com/fwlink/?LinkId=397546

By default it is disabled, which will disable all your Web Designer Galleries, including the Style library. Enable it, wait for 24 hours and try uploading the files again.

  • I did this the other day but forgot to write the answer here, thanks though! – ChrisBull Mar 22 '17 at 9:21

The Custom Scripts Enabled setting was already enabled in our tenant, and we still had the issue described. The following post from 2015 helped us find a solution

We noticed a Deny - Add and Customize Pages - Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Microsoft SharePoint Foundation-compatible editor. permission being applied to all users by default in our newly created Site Collections (check for this using the Check Permissions option).

This permission turns out to be the culprit, as we saw really inconsistent behavior with the ability to specifically Delete files after adding them to the Style Library. I think this may very well be a bug, or a half-baked feature.

The following Powershell script will help you confirm and then disable this permission for a specific site:

$spoSite = Get-SPOSite -Identity https://tenantname.sharepoint.com/teams/someteamsite

(Will get the specified site)


(Will show Enabled if access is being denied, and disabled if not)

Set-SPOSite -Identity https://asurion.sharepoint.com/teams/SharePointTeamBlog -DenyAddAndCustomizePages $false

(Will disable the property, and remove the offending permission)

A solution that would remove this restriction from a specific user (Site Collection Admins or Full Control users) would be better, but I haven't found that solution yet.

If anyone can provide any additional context into why this is happening, it would be nice.


It worked for me after running:

Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0

Even after verifying that I was a site collection administrator and that "Allow custom scripts" was enabled. Modern experience in my case.

  • Did you require tenant admin permissions or just the Site Admin worked ? – Murtuza Husain May 26 '20 at 6:47

Site Scripting was enabled - but I could not upload CSS to tenant Style Library.

Running below worked for me:

Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.