Share via


SPRoleCollection.Item Property (String)

NOTE: This API is now obsolete.

Obsolete. Use the new SPRoleDefinition and SPRoleAssignment classes instead, to define roles and to assign users to them. For more information, see Authorization Object Model. (In Windows SharePoint Services 2.0, the Item property returned the role object with the specified name from the collection and is maintained for backward compatibility.)

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")> _
Public ReadOnly Property Item ( _
    name As String _
) As SPRole
    Get
'Usage
Dim instance As SPRoleCollection
Dim name As String
Dim value As SPRole

value = instance.Item(name)
[ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")]
public SPRole this[
    string name
] { get; }

Parameters

Property Value

Type: Microsoft.SharePoint.SPRole
An SPRole object that represents the role.

See Also

Reference

SPRoleCollection Class

SPRoleCollection Members

Item Overload

Microsoft.SharePoint Namespace