0 out of 1 rated this helpful - Rate this topic

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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
[ClientCallableExceptionConstraintAttribute(FixedId = "System.ArgumentException$0", ErrorType = typeof(ArgumentException), 
	ErrorCode = , Condition = "The user or group does not exist in the collection at the given scope")]
[ClientCallableMethodAttribute(Name = "GetByPrincipal", ReturnObjectIdentity = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "System.UnauthorizedAccessException$-2147024891", 
	ErrorType = typeof(UnauthorizedAccessException), Condition = "")]
public SPRoleAssignment GetAssignmentByPrincipal(
	SPPrincipal principalToFind
)

Parameters

principalToFind
Type: Microsoft.SharePoint.SPPrincipal
The user or group.

Return Value

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

principalToFind is null.

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

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ