SPGroup.ExplicitlyContainsCurrentUser property

Gets a Boolean value that indicates whether the current user has been added explicitly as a direct member of the SharePoint Foundation group, as opposed to indirect membership through a directory group.

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

public bool ExplicitlyContainsCurrentUser { get; }

Property value

Type: System.Boolean
true if the current user is a direct member of the group; otherwise, false. If the group object contains a domain group that includes the current user but the group object does not directly include the user, this property returns false.

The ContainsCurrentUser property considers both direct and indirect membership.