SPPermission.PermissionMask 属性
请注意:此 API 现在已过时。
获取或设置的权限的用户或组的权限掩码。
命名空间: Microsoft.SharePoint
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
<ObsoleteAttribute("Use the SPRoleAssignment class instead")> _
Public Property PermissionMask As SPRights
Get
Set
用法
Dim instance As SPPermission
Dim value As SPRights
value = instance.PermissionMask
instance.PermissionMask = value
[ObsoleteAttribute("Use the SPRoleAssignment class instead")]
public SPRights PermissionMask { get; set; }
属性值
类型:Microsoft.SharePoint.SPRights
SPRights 值,该值指定的权限。
备注
若要定义包含多个权限的权限掩码,使用 Microsoft Visual C# 或Or在 Microsoft Visual Basic 中的管道符号 ("|") 来分隔权限。
示例
下面的代码示例修改某个组,使其可以管理列表和管理列表权限的权限的权限掩码。
Dim siteCollection As SPSite = SPContext.Current.Site
Dim site As SPWeb = siteCollection.AllWebs("Site_Name")
Dim member As SPMember = site.Roles("Role_Name")
site.Permissions(member).PermissionMask =
SPRights.ManageLists Or SPRights.ManageListPermissions
SPSite oSiteCollection = SPContext.Current.Site;
using(SPWeb oWebsite = oSiteCollection.AllWebs["Site_Name"])
{
SPMember oMember = oWebsite.Roles["Role_Name"];
oWebsite.Permissions[oMember].PermissionMask =
SPRights.ManageLists | SPRights.ManageListPermissions;
}
备注
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.