MOSS 2007:更改组权限 - 使用对象模型C# [英] MOSS 2007 : Change Group Permission - Using Object Model C#

查看:83
本文介绍了MOSS 2007:更改组权限 - 使用对象模型C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在尝试更改群组权限,如下所示,



< b>组名 - 许可 - 新许可



TestSite会员 - 贡献者 - 只读

TestSiteOwner - 完全控制 - 只读



我可以添加权限但无法删除原始权限。



Ex:



我已向TeamSiteMember Group添加了只读权限。但是我无法删除贡献者权限。





我是这个开发的新手。有人帮我解决这个问题。



问候,

Prabhu P

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

推荐答案

当你打破继承时,尝试使用



When you break the inheritance, try to use

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





设置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.


这篇关于MOSS 2007:更改组权限 - 使用对象模型C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆