SPRoleDefinitionBindingCollection.Add Method
Adds the specified role definition to the binding collection.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
<ClientCallableMethodAttribute(ClientMethodEndCodeSnippet := "AddChild({0});")> _
<ClientCallableExceptionConstraintAttribute(FixedId := "0", ErrorType := GetType(SPException), _
Condition := "Cannot grant a Guest Role or Role is already added.", _
ErrorCode := )> _
Public Sub Add ( _
roleDefinition As SPRoleDefinition _
)
'Usage
Dim instance As SPRoleDefinitionBindingCollection
Dim roleDefinition As SPRoleDefinition
instance.Add(roleDefinition)
[ClientCallableMethodAttribute(ClientMethodEndCodeSnippet = "AddChild({0});")]
[ClientCallableExceptionConstraintAttribute(FixedId = "0", ErrorType = typeof(SPException),
Condition = "Cannot grant a Guest Role or Role is already added.",
ErrorCode = )]
public void Add(
SPRoleDefinition roleDefinition
)
Parameters
roleDefinition
Type: Microsoft.SharePoint.SPRoleDefinitionThe role definition to add.
Remarks
The role definition that is added must be part of the role definition collection that is used in a role assignment.
See Also
Reference
SPRoleDefinitionBindingCollection Class