Share via


RoleAssignmentCollection.GetByPrincipalId method

Returns the role assignment associated with the specified principal ID.

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

Syntax

'Declaration
Public Function GetByPrincipalId ( _
    principalId As Integer _
) As RoleAssignment
'Usage
Dim instance As RoleAssignmentCollection
Dim principalId As Integer
Dim returnValue As RoleAssignment

returnValue = instance.GetByPrincipalId(principalId)
public RoleAssignment GetByPrincipalId(
    int principalId
)

Parameters

  • principalId
    Type: System.Int32

    A 32-bit integer that specifies the principal ID.

Return value

Type: Microsoft.SharePoint.Client.RoleAssignment
A RoleAssignment object that represents the role assignment.

Exceptions

Exception Condition
ArgumentException

The user or group does not exist in the collection at the given scope. Error code: -2147024809.

UnauthorizedAccessException

The current user does not have sufficient permissions to enumerate permissions on the parent securable object. Error code: -2147024891.

See also

Reference

RoleAssignmentCollection class

RoleAssignmentCollection members

Microsoft.SharePoint.Client namespace