Share via


RoleDefinitionCollection.Add method

Adds a new role definition to the collection based on the passed parameter.

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

Syntax

'Declaration
Public Function Add ( _
    parameters As RoleDefinitionCreationInformation _
) As RoleDefinition
'Usage
Dim instance As RoleDefinitionCollection
Dim parameters As RoleDefinitionCreationInformation
Dim returnValue As RoleDefinition

returnValue = instance.Add(parameters)
public RoleDefinition Add(
    RoleDefinitionCreationInformation parameters
)

Parameters

Return value

Type: Microsoft.SharePoint.Client.RoleDefinition
A RoleDefinition object that represents the new role definition to be added.

Exceptions

Exception Condition
SPException

A role definition with the same characteristics already exists. Error code: -2130575293. There are more than 1000 role definitions added to the same site. Error code: -2130575259.

ArgumentException

HasUniqueRoleDefinitions property is not set to true for the current site. Error code: - 2147024809

See also

Reference

RoleDefinitionCollection class

RoleDefinitionCollection members

Microsoft.SharePoint.Client namespace