Share via


SPRoleDefinitionCollection.GetByType method

Returns the role definition of the specified type from the collection.

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

Syntax

'Declaration
Public Function GetByType ( _
    roleType As SPRoleType _
) As SPRoleDefinition
'Usage
Dim instance As SPRoleDefinitionCollection
Dim roleType As SPRoleType
Dim returnValue As SPRoleDefinition

returnValue = instance.GetByType(roleType)
public SPRoleDefinition GetByType(
    SPRoleType roleType
)

Parameters

Return value

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

Exceptions

Exception Condition
ArgumentException

Either SPRoleType.None was passed as an argument or a definition with the specified role type was not found.

Remarks

A role definition collection can contain only one role definition for each SPRoleType.

See also

Reference

SPRoleDefinitionCollection class

SPRoleDefinitionCollection members

Microsoft.SharePoint namespace