SPRoleDefinitionBindingCollection Class

Defines the role definitions that are bound to a role assignment object.

Inheritance Hierarchy

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

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<SubsetCallableTypeAttribute> _
<ClientCallableTypeAttribute(Name := "RoleDefinitionBindingCollection", ServerTypeId := "{07bf1941-6953-4761-b114-58374b4aaf57}",  _
    CollectionChildItemType := GetType(SPRoleDefinition))> _
Public NotInheritable Class SPRoleDefinitionBindingCollection _
    Inherits SPBaseCollection
'Usage
Dim instance As SPRoleDefinitionBindingCollection
[SubsetCallableTypeAttribute]
[ClientCallableTypeAttribute(Name = "RoleDefinitionBindingCollection", ServerTypeId = "{07bf1941-6953-4761-b114-58374b4aaf57}", 
    CollectionChildItemType = typeof(SPRoleDefinition))]
public sealed class SPRoleDefinitionBindingCollection : SPBaseCollection

Remarks

If a user has both the Full Control and Contribute roles, the role assignment for the user includes these two role definitions in the role definition binding collection.

To get the collection of role definitions that are bound to a role assignment, use the RoleDefinitionBindings property of the SPRoleAssignment class. Use the Add method to add a role definition to the collection.

Use an indexer to return a single item from the collection. For example, if the collection is assigned to a variable named myRoleDefinitionBindings, use myRoleDefinitionBindings[index] in C# or myRoleDefinitionBindings(index) in Visual Basic, where index is either the index number of the item in the collection or a string that contains the name of the role definition.

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

SPRoleDefinitionBindingCollection Members

Microsoft.SharePoint Namespace