惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
腾讯CDC
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学

博客园 - ◎寶☆呗

Sharepoint 自定义字段(栏) 动态获取数据 Sharepoint 工具使用总结 Sharepoint 内存泄漏 检测工具+-- Extjs 中的tbar中的事件 winform Tab键循序 小发现 instsrv.exe——来自Windows 2000 Resource Kits的一个小工具 [转载]MOSS 2007 SP1 stsadm 194 条指令 (用命令行部署infopath Form )Deploy administrator-approved form templates using command line sharepoint计时器(定时发邮件) Infopath开发经验(xml数据) 基本活动:CodeActivity Creating a Custom SharePoint 2007 List Definition 通过Sharepoint扩展的Webserives来获取某一权限是是否存在 执行带返回参数的存储过程 Sorry.....Sorry..... 操作Infopath中的XMl C#编程规范<二> C#代码规范. 工作需要养成的习惯(个人经验)
Create a New SharePoint Permission Level and Bind it to a...
◎寶☆呗 · 2008-01-17 · via 博客园 - ◎寶☆呗
Create a New SharePoint Permission Level and Bind it to an Existing SharePoint Group

 这个例子是新建一个  permission level,名字为Example_xxxxxxxxxxx.建好之后.绑定这个permission level 到一个已经存在的组名字为Foo.

using (SPSite site = new SPSite( "http://moss/sites/PermExample" ))
{
   using (SPWeb rootWeb = site.RootWeb)
   {
       string permissionLevelName = "Example_"+System.DateTime.Now.Ticks.ToString();

        // Create a new Permission Level
        SPRoleDefinition newPermissionLevel = new SPRoleDefinition();
        newPermissionLevel.Name = permissionLevelName;
        newPermissionLevel.Description = "Example Permission Level";
        newPermissionLevel.BasePermissions =
                SPBasePermissions.AddListItems |
                SPBasePermissions.BrowseDirectories |
                SPBasePermissions.EditListItems |
                SPBasePermissions.DeleteListItems |
                SPBasePermissions.AddDelPrivateWebParts;

        // Add the permission level to web
        rootWeb.RoleDefinitions.Add(newPermissionLevel);

        // Bind to the permission level we just added
        newPermissionLevel = rootWeb.RoleDefinitions[permissionLevelName];

        // Create a new role Assignment using the SharePoint Group "Foo"
        SPRoleAssignment roleAssignment = new SPRoleAssignment( (SPPrincipal)rootWeb.SiteGroups[ "Foo" ] );

        // Add the Permission Level to the Foo SharePoint Group
        roleAssignment.RoleDefinitionBindings.Add(newPermissionLevel);

        // Add the new Role Assignment to the web
        rootWeb.RoleAssignments.Add(roleAssignment);

        rootWeb.Close();
   }
   site.Close();
}
这样就新建成功了.也绑定到了已经存在的组.!

另一种是不写代码直接在网站上添加的方法

Create a permission level

If there is no permission level similar to the one you need, you can create one and include just the permissions that you need.
1:On the Site Settings page, under Users and Permissions, click Advanced permissions.
2:On the toolbar, click Settings, and then click Permission Levels.
3:On the toolbar, click Add a Permission Level.
4:On the Add a Permission Level page, in the Name box, type a name for the new permission level..
5:In the Description box, type a description for the new permission level..
6:In the list of permissions, select the check boxes to add permissions to the permission level
7:Click Create.