技术开发 频道

MOSS字段编辑权限控制方案-添加管理链接


【IT168技术文档】

  feature.xml
<Feature Id="E5441FAC-1D99-4ecc-98AA-D76D5BBDCDE9" Title="$Resources:codeArt,FieldRight_Feature_Title;" Description="$Resources:codeArt,FieldRight_Feature_Des;" Scope="Site" Hidden="FALSE" DefaultResourceFile="codeArt" xmlns="http://schemas.microsoft.com/sharepoint/" > <ElementManifests> <ElementManifest Location="Elements.xml"/> </ElementManifests> </Feature>
  Elements.xml
<?xml version="1.0" encoding="utf-8" ?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="CodeArt.FieldValueEditControl" GroupId="GeneralSettings" Location="Microsoft.SharePoint.ListEdit" Sequence="106" Title="$Resources:codeArt,FieldRightSetting;"> <UrlAction Url="~site/_layouts/CodeArt/FieldEditControl.aspx?ListId={ListId}"/> </CustomAction> </Elements>
  feature.xml声明了feature的ID,名称,范围(farm,site collection,web)。
  Elements.xml采用一个CustomAction元素添加管理链接,Location属性说明添加菜单到列表设置页面,GroupId属性指定菜单添加到常规设置组。
  UrlAction制定链接页面地址,注意~site这个字符,~site取得是当前web的路径。{ListId}在系统呈现链接时会自动替换成当前List的Guid,管理页面
  可以通过这个Guid获取当前管理的list:
SPList list = SPContext.Current.Web.Lists[new Guid(Request.QueryString["ListId"])];
0
相关文章