RoleAssignmentCollection.GetByPrincipalId Method

Returns the role assignment associated with the specified principal ID.

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
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)
[RemoteAttribute]
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