Share via


SPRoleDefinitionCollection.GetById method

Gets the role definition with the specified ID from the collection.

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

Syntax

'Declaration
Public Function GetById ( _
    id As Integer _
) As SPRoleDefinition
'Usage
Dim instance As SPRoleDefinitionCollection
Dim id As Integer
Dim returnValue As SPRoleDefinition

returnValue = instance.GetById(id)
public SPRoleDefinition GetById(
    int id
)

Parameters

  • id
    Type: System.Int32

    A 32-bit integer that specifies the ID. The value of the ID does not correspond to the index of the role definition within the collection.

Return value

Type: Microsoft.SharePoint.SPRoleDefinition
An SPRoleDefinition object that represents the role definition.

Exceptions

Exception Condition
ArgumentException

A role definition with the specified ID does not exist in the collection.

See also

Reference

SPRoleDefinitionCollection class

SPRoleDefinitionCollection members

Microsoft.SharePoint namespace