共用方式為


SPPrincipal.Roles Property

NOTE: This API is now obsolete.

Gets the collection of roles associated with the principal.

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

Syntax

'Declaration
<ObsoleteAttribute("Use the SPRoleAssignment class instead")> _
Public ReadOnly Property Roles As SPRoleCollection
    Get
'Usage
Dim instance As SPPrincipal
Dim value As SPRoleCollection

value = instance.Roles
[ObsoleteAttribute("Use the SPRoleAssignment class instead")]
public SPRoleCollection Roles { get; }

Property Value

Type: Microsoft.SharePoint.SPRoleCollection
An SPRoleCollection object that represents the roles.

See Also

Reference

SPPrincipal Class

SPPrincipal Members

Microsoft.SharePoint Namespace