Welcome to Comunidade Bloggers |create|it| Sign in | Join | Help
How to add a group to a WSS v3 site

Get the group

SPGroup group = web.SiteGroups["GROUP_NAME"];

Create a role assignment

SPRoleAssignment newRoleAssignment = new SPRoleAssignment(group);

Add the role definition (Full Control, Read, Contribute, …) to the role assignment

newRoleAssignment.RoleDefinitionBindings.Add(web.RoleDefinitions["Full Control"]);

And add the role assignment to the web

web.RoleAssignments.Add(newRoleAssignment);

 

Posted: Friday, September 21, 2007 10:02 AM by ricardo.costa
Filed under:

Comments

No Comments

Anonymous comments are disabled