2

I wanted to delete a user permission from ONE of the various document libraries in a SharePoint site.

But when i deleted the permission, it seemed to have deleted the user permission at a much higher level (site level?)

This caused the user not being able to access ALL the document libraries instead.

How do i delete the user permission from one of the document library only?

1
  • I too have experienced the same issue as the original poster . The code loops through the RoleAssignments collection and removes the group from the List. Then for good measure it goes and removes the group from the site. $spRoleAssignments=$list.RoleAssignments for([int] $a=$spRoleAssignments.Count-1; $a -ge 0;$a--) { $spRoleAssignments.Remove($a); } i.e. the $spRoleAssignments.Remove($a); line gets fired a second time! Any ideas ? – user40699 Mar 20 '15 at 12:02
2

You need to go to Document Library Ribbon -> Under Library -> Library Settings -> Permissions for this document library OR simply Document Library Ribbon -> Under Library -> Library Permissions

By default the document library will be inheriting permissions from Site, you need to click "Stop Inheriting permissions" ribbon button to stop that..

Stop Inheriting Permissions

Than you can delete the users and it won't affect the Site..

0

If you need to remove permissions programmatically you should first break inheritance:

list.BreakRoleInheritance(true);

After that you can for example remove all role assignments for list or library and it does not effect for higher levels:

SPRoleAssignmentCollection roleAssignmentCollection = list.RoleAssignments;
for (int i = roleAssignmentCollection.Count - 1; i >= 0; i--)
{
   roleAssignmentCollection.Remove(i);
}
0

Follow this steps

got to Library Permission

by default, library inherits permissions from parent. Just click on Stop Inheriting permissions.

after that, Delete the users or groups which you don't want.

Add the users or groups that you want library to be accessible. and save.

library will than have unique permissions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.