Forum Discussion
Access Denied on Document Library webpart in modern pages
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.