Moss 添加用户组并赋予权限

给网站新增一个用户组“Members”,给用户组赋予“参与讨论”权限,并新增所有授权用户

SPRoleDefinition oRole = newWeb.RoleDefinitions["参与讨论"];
SPGroup oGroup = newWeb.SiteGroups["Members"];
SPRoleAssignment oRoleAssignment
= new SPRoleAssignment(oGroup);
oRoleAssignment.RoleDefinitionBindings.Add(oRole);
newWeb.RoleAssignments.Add(oRoleAssignment);

oGroup.Users.Add(
"NT Authority\\Authenticated Users", "",
 "NT Authority\\Authenticated Users", "");

你可能感兴趣的:(OS)