Compartilhar 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)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class SPPolicyRoleBindingCollection _
    Inherits SPBaseCollection
'Usage
Dim instance As SPPolicy.SPPolicyRoleBindingCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, 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