Share via


SPRoleAssignmentCollection class

表示可保護物件的角色指派的集合。

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.SPBaseCollection
      Microsoft.SharePoint.SPRoleAssignmentCollection

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public NotInheritable Class SPRoleAssignmentCollection _
    Inherits SPBaseCollection
'用途
Dim instance As SPRoleAssignmentCollection
public sealed class SPRoleAssignmentCollection : SPBaseCollection

備註

您可以使用RoleAssignmentsSPPermissionInfoSPSecurableObjectSPListSPListItemSPWeb類別屬性,傳回指定物件的角色指派的集合。

若要建立有沒有角色定義繫結的角色指派,請使用SPRoleAssignment建構函式。若要新增角色指派結合的角色定義,使用ImportRoleDefinitionBindings方法。使用SPRoleAssignmentCollection類別的Add方法來新增角色指派至角色指派物件的集合。

使用索引子來從集合傳回單一項目。例如,如果集合指派給一個名為myRoleAssignments變數,用於myRoleAssignments[index]中Visual Basic,C# 或myRoleAssignments(的index)index所在集合中項目的索引數字或字串,其中包含角色定義的名稱。

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

請參閱

參照

SPRoleAssignmentCollection members

Microsoft.SharePoint namespace