Share via


SPPolicy.SPPolicyRoleBindingCollection class

Represents the collection of policy roles through which each user or group is bound to a policy.

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.SPBaseCollection
      Microsoft.SharePoint.Administration.SPPolicy.SPPolicyRoleBindingCollection

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

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public Class SPPolicyRoleBindingCollection _
    Inherits SPBaseCollection
'Usage
Dim instance As SPPolicy.SPPolicyRoleBindingCollection
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public class SPPolicyRoleBindingCollection : SPBaseCollection

Remarks

Each user or group is assigned to policy roles using a policy role binding collection. This collection returns policy roles, but it does not define the existence of the policy roles.

Use the PolicyRoleBindings property of the SPPolicy class to return the collection of policy role bindings for a policy. To create a policy role in the collection, use the Add or AddById method.

Use an indexer to return a single policy role from the collection of role bindings. For example, if the collection is assigned to a variable named myPolicyRoleBindings, use myPolicyRoleBindings[index] in C#, or myPolicyRoleBindings(index) in Visual Basic .NET, where index is either the index number of the policy role in the collection, or an SPPolicyRole object.

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.

See also

Reference

SPPolicy.SPPolicyRoleBindingCollection members

Microsoft.SharePoint.Administration namespace