RoleDefinitionCollection.Add Method
Adds a new role definition to the collection based on the passed parameter.
Namespace: Microsoft.SharePoint.Client
Assemblies: Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll); Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
<RemoteAttribute> _
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)
[RemoteAttribute]
public RoleDefinition Add(
RoleDefinitionCreationInformation parameters
)
Parameters
parameters
Type: Microsoft.SharePoint.Client.RoleDefinitionCreationInformationA RoleDefinitionCreationInformation object that represents information associated with the role definition.
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