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

[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


Type: Microsoft.SharePoint.SPRoleDefinition

The role definition to add.

The role definition that is added must be part of the role definition collection that is used in a role assignment.