SharePoint: How to prevent public link access to folder content?

Maxime P 11 Reputation points
2023-06-26T16:08:24.4266667+00:00

Hi,

I have a library on Sharepoint Online site with access limited to a small group of person.

I create "anyone" link to content and post these link where needed. This gives me some kind of control on who can access content.

Today I realized that SharePoint let user see all public content of the folder (and parent folder) where the shared file is located.

So when sharing file "Explorer le ruban", the header shows the location of the file, and let the user open the folder.

User's image

After opening the folder, all files with public link are displayed :

User's image

I don't want this to happen since the link to other files might have been shared with another group of user.

I know that anyone link let anybody with the link see the content. However there is a huge difference in using an anyone link that you found, and beeing able to browse all files. I might have created an anyone link for a file but never share it, and the file will be accessible in the folder.

Thanks in advance for you help

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Maxime P 11 Reputation points
    2023-06-26T16:12:32.8633333+00:00

    Ok, nevermind.

    I realized that folder browsing shows you only the public files that you have opened in current session, which was my case after creating many public links.

    When I start a fresh private session with my browser, I don't see other files.

    0 comments No comments

  2. Zehui Yao_MSFT 5,876 Reputation points
    2023-06-30T08:25:42.6033333+00:00

    Hi Maxime P

    According to my tests, if you set your site to public, then when you share files with users in the same tenant, they can browse other files in the folder. 

    You can set site as a private group, so that only site members can browse other files, and other users can only browse shared files.

    Hope this helps. Best Wishes.

    image

    image (1)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.