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

推荐订阅源

The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Recorded Future
Recorded Future
I
Intezer
云风的 BLOG
云风的 BLOG
博客园 - Franky
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
T
Tenable Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Attack and Defense Labs
Attack and Defense Labs
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
Webroot Blog
Webroot Blog
W
WeLiveSecurity
H
Heimdal Security Blog
博客园 - 三生石上(FineUI控件)
V
Vulnerabilities – Threatpost
G
Google Developers Blog
O
OpenAI News
V
V2EX
罗磊的独立博客
博客园_首页
N
News | PayPal Newsroom
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
H
Hacker News: Front Page
博客园 - 叶小钗
T
Tor Project blog
AI
AI

博客园 - ◎寶☆呗

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 an Existing SharePoint Group
◎寶☆呗 · 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.