Share via


SPRoleDefinitionCollection.Item property (String)

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

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

Syntax

'Declaration
Public ReadOnly Default Property Item ( _
    name As String _
) As SPRoleDefinition
    Get
'Usage
Dim instance As SPRoleDefinitionCollection
Dim name As String
Dim value As SPRoleDefinition

value = instance(name)
public SPRoleDefinition this[
    string name
] { get; }

Parameters

Property value

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

Exceptions

Exception Condition
SPException

The collection does not contain a role definition with that name.

Remarks

If the collection contains two role definitions with the same name, the indexer returns the first one that is found.

See also

Reference

SPRoleDefinitionCollection class

SPRoleDefinitionCollection members

Item overload

Microsoft.SharePoint namespace