I have a site collection with permissions set up as: EVERYONE READ I have a custom list. Here, I want to add permissions as EVERYONE CONTRIBUTE. I want to remove the Everyone Read Access Permssions but retain all other permissions like site members, owners, visitors etc to remain the same as that of site collection.

I am using this code to change the permssions(powershell and CSOM) :

$myList= $context.Web.Lists.GetByTitle(“Emp List”)
$myList.breakRoleInheritance($true, $false)
$everyone = $context.Web.EnsureUser("EveryOne") 
$roledefbingding_EveryOne=New-Object Microsoft.SharePoint.Client.RoleDefinitionBindingCollection $context
$context.Load($myList.RoleAssignments.Add($everyone, $roledefbingding_EveryOne))

The above code is perfectly working.

But it removes all other permissions for the list like: visitors, owners etc. - This is not expected. May be it happens because of the below line of code:

 $myList.breakRoleInheritance($true, $false)

I tried $myList.breakRoleInheritance($false, $true) But this will add permission as : EVERYONE READ,CONTRIBUTE - This is not expected.

This code adds "EVERYONE" as Contributors - This is expected.

DO I need to remove existing role ? If so please help me how to achieve this?


2 Answers 2


Try just deleting the Read role definition after adding the Contribute definition as follows:

$myList= $context.Web.Lists.GetByTitle(“Emp List”);
$myList.breakRoleInheritance($true, $false);
$everyone = $context.Web.EnsureUser("EveryOne");
$roledefbingding_EveryOne=New-Object Microsoft.SharePoint.Client.RoleDefinitionBindingCollection $context;
$context.Load($myList.RoleAssignments.Add($everyone, $roledefbingding_EveryOne));

Your right breakRoleInheritance will break everything. Test it out in front end UI.

breakRoleInheritance : List will not inherit anything from sitecollection. You may need to add the remaining Groups in powershell again.

  • This answer doesn't add any value because it simply states the obvious that was already noted (more elaborately) in the question itself. Commented Sep 24, 2018 at 21:11

Your Answer

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

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