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)
Syntax
'Declaration
<ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")> _
Public ReadOnly Default Property Item ( _
name As String _
) As SPRole
Get
'Usage
Dim instance As SPRoleCollection
Dim name As String
Dim value As SPRole
value = instance(name)
[ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")]
public SPRole this[
string name
] { get; }
Parameters
name
Type: System.StringA string that contains the name.
Property value
Type: Microsoft.SharePoint.SPRole
An SPRole object that represents the role.