Access Denied on Document Library webpart in modern pages

Copper Contributor



We use 2 document library webparts in our modern team site landing pages - one for Shared Documents which everyone has access to, and another for Internal Documents where we restrict permissions only to internal users.


Until recently, this works really well.  Internal users will see contents on both webparts, while external users will see an Access Denied image in place of the Internal Documents webpart.


However, since yesterday our external users are totally unable to access the page.  They are thrown to the full page Access denied page.


Could you please advise if this is now the expected behaviour or if there's a better way of showing the 2 libraries on the same page ?




9 Replies
Best you can do here is to open a support ticket...if this was working until now and nothing has changed in the site, it might happen Microosft has updated the WebParts and the update is causing this

Thanks Juan Carlos, how do I open a support ticket ?


I normally open support premier between this link:


So I click in "do you need help?" in bottom.






I'm having the same issue - this used to work and now it does not, but I think I found a workaround.


I created a custom permission that contains only the "View Application Pages" permission. Then I granted that permission on the secured library to all users.


I verified that this allows the webpart to display, but that files get security trimmed.


If anyone else can test this and point out any unexpected consequences, I'd appreciate feedback.

I've been doing the same as a quick workaround.  The issue is that our external users can still see the message "Drag files here" which is causing confusion.  I had to inject CSS through an spfx webpart to hide it.  Also, I'm worried that a future release from Microsoft suddenly causes this security change to show the restricted files to our externals which is very unacceptable.


We have about 50 pages affected by this issue.  I am fixing each one on demand but it has already compromised our end user's confidence in using SharePoint as a platform for document management. I have raised a ticket to MS and they have acknowledged the bug but hasn't come back since for a resolution.  Hopefully a more elegant and streamline solution is provided asap.

the access denied redirect should be fixed in the near future as a fix has been done and deploying to production



Hello, cannot we just hide the document library web part instead of showing it with an access denied error? @Bruno Aleixo 

@Li Su Have you found any work around for this. I am also facing the issue.