Share via


SPRoleAssignmentCollection.GetAssignmentByPrincipal method

Gets the role assignment object based on the specified user or group.

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

Syntax

'Declaration
Public Function GetAssignmentByPrincipal ( _
    principalToFind As SPPrincipal _
) As SPRoleAssignment
'Usage
Dim instance As SPRoleAssignmentCollection
Dim principalToFind As SPPrincipal
Dim returnValue As SPRoleAssignment

returnValue = instance.GetAssignmentByPrincipal(principalToFind)
public SPRoleAssignment GetAssignmentByPrincipal(
    SPPrincipal principalToFind
)

Parameters

Return value

Type: Microsoft.SharePoint.SPRoleAssignment
The role assignment for the specified user or group.

Exceptions

Exception Condition
ArgumentNullException

principalToFind is null .

Remarks

This method retrieves the role assignment of the user or group specified by the principalToFind parameter.

See also

Reference

SPRoleAssignmentCollection class

SPRoleAssignmentCollection members

Microsoft.SharePoint namespace