How do I lock a view on SharePoint Online?

Jolyn Johnson 86 Reputation points
2023-07-18T16:23:07.54+00:00

I have a communications intranet site (business Enterprise license) where I have many document libraries and want them to have different views for different departments (HR, IT, etc.). I have created the various views needed, and then made different pages with a modern web part of a document library added to each page to match. I'm trying to lock the views so that someone from HR will only be able to view their documents and edit them, someone from IT will be able to do the same, etc. yet when I switch from page to page the view sometimes changes randomly (Benefits will become IT, and then of course no documents or folders are visible).

How can I lock the view for each page?

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Accepted answer
  1. Iftikhar Ali 170 Reputation points
    2023-08-13T07:09:01.6866667+00:00

    To ensure that the views on your communications intranet site remain consistent for different departments, follow these steps:

    Edit Web Part: For each modern web part of a document library on different pages:

    Click on the web part's "Edit" or "Modify" option.

    Default View:

    In the web part settings, choose the desired view specific to that department (HR, IT, etc.) from the "Selected View" dropdown.

    Save or apply the changes.

    Repeat for Each Page:

    Repeat these steps for every page where you've added a document library web part.

    Permissions: Ensure that permissions are appropriately set.

    In the document library settings, configure permissions so that users from HR can only access HR documents, IT users can access IT documents, etc.

    Assign unique permissions for each department by using SharePoint groups or individual user permissions.

    Test: Test the pages by navigating between them. The chosen view and associated permissions should remain consistent as users switch between pages.

    Monitor and Adjust: Regularly check and validate that the views and permissions remain intact. If issues persist, review your settings and permissions to ensure they are correctly configured.

    By following these steps, you should be able to lock the views for each department's page on your communications intranet site and ensure that users only see the documents and folders relevant to their department.

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

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Emily Du-MSFT 51,846 Reputation points Microsoft External Staff
    2023-07-19T10:12:49.5166667+00:00

    Currently, there is no method to switch view automatically when accessing from page to page.

    As a workaround, I suggest you establish different folders according to different departments. Then grant permissions for each folder according to the corresponding department. After that, when accessing the document library, each department can only see its corresponding folder.

    Select the folder -> Manage Access -> Click More options in the upper right corner -> Advanced settings -> Stop Inheriting permissions -> Grant permissions.

    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.