Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to change the Group permissions as follows,

Group Name - Permission - New Permission

TestSiteMember - Contributor - Read Only
TestSiteOwner - Full Control - Read Only

I am able to add the permission but not able to remove the original permission.

Ex :

I have added Read Only permission to TeamSiteMember Group. But i am not able to remove Contributor permission.


I am New to this Development.Kindly anybody help me to fix this.

Regards,
Prabhu P
Posted

1 solution

When you break the inheritance, try to use

SPGroup contributeGroup = web.SiteGroups["TestSiteMember"];
properties.ListItem.BreakRoleInheritance(false);


Setting the BreakRoleInheritance(false) will not copy the inherited roles to the item and then you can add the permissions you want to afresh using

properties.ListItem.RoleAssignments.Add()


Hope this helps.
 
Share this answer
 
Comments
Prabhu_Pappu 31-May-13 10:30am    
Thank for heads up
unfortunately, I want to change the Sharepoint site group permission. Not the list permission.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900