Show all files in the document folder view / structure, but limit access to individual files in Sharepoint Online

Is there a way in Sharepoint online to allow anyone who has access to a Sharepoint page to see all the files within a folder but restrict certain users from actually viewing the files? So, for example, I have files inside folder A, for example:

A folder

  • 1.ext file
  • 2.ext file
  • 3.ext file

I would like everyone to see all 3 files within the folder structure, however, I would like to restrict access to file 3 and only allow certain users to see that file.

Currently, if I restrict access to file 3, they will no longer see it in the document tree.

I managed to do this when I use vanity links in the "quick links" module in the SP page generator when I link to a file. I would like this same behavior to occur at the root of my document if possible. See the image below for what happens when you link to an SP file through a custom link …

request access to the image

I think this is important because we have a large company with many users and I'm not sure if we are going to grant access to each file to all the right people. With this method, users can request access. Thanks for your help.