3

Suppose I create a group "XYZ" who has full control on site . I will break permission inheritance of rootfolders (from folder starting with A to J) inside document library "abc" and assign a "XYZ" group with full control permissions to those folders.

My questions are

  1. Do other group having full control permission would still be able to access it ?
  2. How to make those folders accessible only to XYZ group and not others having full Control permissions.

1 Answer 1

6

Those groups will not be able to access the folders if the permission for the folder is broken and only the group "XYZ" has permissions to the folder and rest all are removed.

UPDATE

Sample powershell code:

$folders = $list.Folders
foreach ($spFolder in $folders)
{   
    $PermissionLevel = "PermissionName" ;
    $group = $web.SiteGroups[$GroupName];   
    $spFolder.BreakRoleInheritance($false);
    $roleAssignment = New-Object microsoft.sharepoint.SPRoleAssignment($group);
    $roleDefinition = $web.RoleDefinitions[$PermissionLevel];
    $roleAssignment.RoleDefinitionBindings.Add($roleDefinition);   
    $spFolder.RoleAssignments.Add($roleAssignment);       
    $spFolder.Update();   
}
5
  • ok. how do I achieve it using powershell? other full control groups also wont have access to it? Mar 18, 2014 at 9:22
  • See my updated answer Mar 18, 2014 at 9:34
  • Your code will break inheritance of all folders from list. I want to break from root level selective folders only Mar 18, 2014 at 9:40
  • 1
    You need to add logic for that. The code simply demonstrates how to break permissions on a folder and add group to it. You should not rely on spoon feeding. Mar 18, 2014 at 9:42
  • I tested it but it seems that it is still visible to other groups having full control Mar 18, 2014 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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