SPRoleAssignmentCollection.Add 方法 (SPPrincipal)

Creates a new role assignment for a specified security principal and gives the security principal guest access to objects in the current scope and in all parent scopes.

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Sub Add ( _
    principal As SPPrincipal _
)
用法
Dim instance As SPRoleAssignmentCollection
Dim principal As SPPrincipal

instance.Add(principal)
public void Add(
    SPPrincipal principal
)

参数

备注

When this method is called, a new SPRoleAssignment object is created in the collection; the specified security principal is assigned as the value of the Member property; and the role definition for the role type SPRoleType.Guest is added to the RoleDefinitionBindings collection of the object.

另请参阅

引用

SPRoleAssignmentCollection 类

SPRoleAssignmentCollection 成员

Add 重载

Microsoft.SharePoint 命名空间

RoleDefinitions

SPRoleType