Share via


SPPermission.Member Property

NOTE: This API is now obsolete.

Gets the member object for the user or group that has the permission.

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

Syntax

<ObsoleteAttribute("Use the SPRoleAssignment class instead")> _
Public ReadOnly Property Member As SPMember
    Get

Dim instance As SPPermission
Dim value As SPMember

value = instance.Member
[ObsoleteAttribute("Use the SPRoleAssignment class instead")]
public SPMember Member { get; }

Property Value

Type: Microsoft.SharePoint.SPMember
An SPMember object that represents the member.

Remarks

Every user or group associated with a permission has a unique member ID and can be represented by an SPMember object.

Examples

The following code example uses the Member property to display the member IDs for the permissions on a site and the rights associated with each ID.

Dim webSite As SPWeb = SPContext.Current.Web
Dim perms As SPPermissionCollection = webSite.Permissions
Dim perm As SPPermission

For Each perm In  perms

    Response.Write(perm.Member.ID & " :: " & 
        perm.PermissionMask.ToString() & "<BR>")

Next perm
SPWeb oWebsite = SPContext.Current.Web;
SPPermissionCollection collPermissions = oWebsite.Permissions;
foreach (SPPermission oPermission in collPermissions)
{
    Response.Write(oPermission.Member.ID + " :: " +
        oPermission.PermissionMask.ToString() + "<BR>");
}

See Also

Reference

SPPermission Class

SPPermission Members

Microsoft.SharePoint Namespace