Skip to main content

How to Restrict a SharePoint Document Library to One Group

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A document library starts out open to everyone who can open its site. To keep one, say a payroll library, for a single group, give it its own permissions: stop inheriting, remove the site's groups, and grant the one group that should have it. People outside the group then get You need access if they try the library's address.

In the Overtime Timesheet series, the Payroll Exports library will hold a monthly overtime workbook for payroll. All staff can read the site, so the library needs to be closed to everyone except the Overtime Payroll group, who get Read.

Prerequisites​

Step 1: Open Library Settings​

Open the library, then Settings → Library settings:

The Settings panel on a library page with Library settings outlined in red, below Site contents

A Library settings panel opens with the name and description. Select More library settings:

The Library settings panel with the name Payroll Exports, its description, and More library settings outlined in red above Save and Cancel

Step 2: Open Permissions for This Document Library​

Under Permissions and Management, select Permissions for this document library:

The library's Settings page with Permissions for this document library outlined in red under Permissions and Management, between Delete this document library and Manage files which have no checked in version

Step 3: Stop Inheriting Permissions​

The page says This library inherits permissions from its parent. (Overtime Timesheet): the site's three groups, including Visitors, which on this site holds all staff. Select Stop Inheriting Permissions:

The library's Permissions page with Stop Inheriting Permissions outlined in red, the messages about limited access users and inheriting from the parent, and the Members, Owners and Visitors groups

The browser asks:

You are about to create unique permissions for this document library. Changes made to the parent site permissions will no longer affect this document library.

Select OK. The message becomes This library has unique permissions. How to Stop Inheriting Permissions on a SharePoint List explains what the copy means.

Step 4: Remove Members and Visitors​

Tick Overtime Timesheet Members and Overtime Timesheet Visitors, select Remove User Permissions, and confirm the browser's question with OK:

The library's Permissions page with the Members and Visitors checkboxes ticked and outlined in red, and Remove User Permissions outlined in red on the ribbon

The question was: "Are you sure you want to remove all permissions for the selected users and groups to "Payroll Exports"?" Only Owners stays. How to Remove a Group's Permissions from a SharePoint List covers this step in detail; it works the same for a library.

Step 5: Grant the Group Read​

Select Grant Permissions, add Overtime Payroll, open SHOW OPTIONS, clear Send an email invitation and choose Read in place of the default Edit:

The Share Payroll Exports and its contents dialog with Overtime Payroll added, Share everything in this folder, even items with unique permissions ticked, Send an email invitation cleared, Read selected and Share, each change outlined in red

A library's dialog is titled Share 'Payroll Exports' and its contents and adds one option a list doesn't have: Share everything in this folder, even items with unique permissions. Microsoft's Customize permissions for a SharePoint list or library: "This will grant or restrict access to items you already set unique permissions for." The library was empty, so it was left ticked. Select Share.

Step 6: Check the Permissions​

Reload the page. Two entries are left: the group with Read and the site's owners:

The library's Permissions page with This library has unique permissions, Overtime Payroll as a Domain Group with Read outlined in red, and Overtime Timesheet Owners with Full Control

Step 7: Test as Someone Outside and Inside the Group​

Aisha Khan, a staff nurse who can read the rest of the site, opened the library's address. SharePoint refused:

The You need access page for Aisha Khan: You don't have access to this list, with a box to write a message to the list owner and a Request access button

The library also no longer appears in her Site contents.

Leo Martin, the payroll officer, opened it. He sees the library, still empty, with no Create or upload command, because Read can't add files:

The Payroll Exports library as Leo Martin, with Add shortcut to OneDrive, Edit in grid view and Pin to Quick access in the command bar, no Create or upload, and the message This folder is empty

How to Check a User's Permissions in SharePoint gives the same answers in words: None for Aisha, and Read for Leo through Overtime Payroll.

Common Mistakes​

MistakeWhat happensDo this instead
Granting the group without removing VisitorsEveryone in Visitors can still read the libraryRemove the copied groups
Sharing with the default EditThe group can add, change and delete files, and manage the libraryChoose the level they need
Leaving Send an email invitation tickedEveryone in the group gets an emailClear it

Troubleshooting​

SymptomLikely causeFix
Someone outside the group can still open itThey're in another group still listed, or they're an ownerUse Check Permissions on the library
The group can't open itIts grant didn't saveReload the Permissions page and check the entry

FAQ​

Who else can open the library?​

The site's owners, through Owners. Microsoft's About the SharePoint Administrator role in Microsoft 365 adds that Global Administrators and SharePoint Administrators "don't have automatic access to all sites and each user's OneDrive, but they can give themselves access to any site or OneDrive."

Should the group get Read or more?​

Whatever it needs. In the Overtime Timesheet series, a flow writes the workbooks and payroll only reads them, so Read is enough.

Conclusion​

Library settings → More library settings → Permissions for this document library → Stop Inheriting Permissions → remove Members and Visitors → Grant Permissions to the one group with the level it needs. Then test it as someone outside the group and someone in it.

Additional Resources​