问题描述
我必须在网站配置类中创建5个组,所有这些都可以正常工作.但是,我想让所有人都可以看到组成员,因此我设置OnlyAllowMembersViewMembership = false,但是当我在sharepoint中查看组设置时,所有组的最终值都等于true.有任何想法吗? 私人 I have to create 5 groups in my site provisioning class and all that is working fine. however, I'm suppose to allow everyone to see the group members so I set OnlyAllowMembersViewMembership = false but all the groups end up with the value equal to true when I view the group settings in sharepoint. Any ideas? private void CreateGroup( SPWeb 网站, 字符串 groupName, SPUser groupOwner, 字符串 权限, 布尔 removeGroupOwner, 字符串 说明) void CreateGroup(SPWeb site, string groupName, SPUser groupOwner, string permission, bool removeGroupOwner, string description) 如果 (removeGroupOwner) if (removeGroupOwner) SPGroup group = site.SiteGroups [groupName]; } SPGroup group = site.SiteGroups[groupName]; } 这篇关于OnlyAllowMembersViewMembership = false不保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
{
site.SiteGroups.Add(groupName,groupOwner,groupOwner,description);
{
site.SiteGroups.Add(groupName, groupOwner, groupOwner, description);
网站. SiteGroups [groupName] .RemoveUser(groupOwner);
site.AssociatedGroups.Add(site.SiteGroups [groupName]);
site.SiteGroups [groupName] .Description = description;
site.SiteGroups [groupName] .OnlyAllowMembersViewMembership = false ;
site.SiteGroups [groupName] .Update();
site.SiteGroups[groupName].RemoveUser(groupOwner);
site.AssociatedGroups.Add(site.SiteGroups[groupName]);
site.SiteGroups[groupName].Description = description;
site.SiteGroups[groupName].OnlyAllowMembersViewMembership = false;
site.SiteGroups[groupName].Update();
SPRoleAssignment groupRoleAssigment = 新 SPRoleAssignment (组);
SPRoleDefinition groupRoleDefinition = site.RoleDefinitions [permission];
groupRoleAssigment.RoleDefinitionBindings.Add (groupRoleDefinition);
site.SiteGroups [groupName] .Update();
site.RoleAssignments.Add(groupRoleAssigment);
site.Update();
SPRoleAssignment groupRoleAssigment = new SPRoleAssignment(group);
SPRoleDefinition groupRoleDefinition = site.RoleDefinitions[permission];
groupRoleAssigment.RoleDefinitionBindings.Add(groupRoleDefinition);
site.SiteGroups[groupName].Update();
site.RoleAssignments.Add(groupRoleAssigment);
site.Update();推荐答案