Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.
share|improve this question

1 Answer 1

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();   
}
share|improve this answer
    
ok. how do I achieve it using powershell? other full control groups also wont have access to it? –  SharePointer Mar 18 at 9:22
    
See my updated answer –  Nadeem Yousuf Mar 18 at 9:34
    
Your code will break inheritance of all folders from list. I want to break from root level selective folders only –  SharePointer Mar 18 at 9:40
    
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. –  Nadeem Yousuf Mar 18 at 9:42
    
I tested it but it seems that it is still visible to other groups having full control –  SharePointer Mar 18 at 10:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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