SPRole.AddUser method (SPUser)

NOTE: This API is now obsolete.

Use the new SPRoleDefinition and SPRoleAssignment classes instead, to define roles and to assign users to them. For more information, see Authorization object model. (In Windows SharePoint Services 2.0, the AddUser method added the specified user to the role and is maintained for backward compatibility.)

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

Syntax

'Declaration
<ObsoleteAttribute("Use the SPRoleDefinition class instead")> _
Public Sub AddUser ( _
    user As SPUser _
)
'Usage
Dim instance As SPRole
Dim user As SPUser

instance.AddUser(user)
[ObsoleteAttribute("Use the SPRoleDefinition class instead")]
public void AddUser(
    SPUser user
)

Parameters

See also

Reference

SPRole class

SPRole members

AddUser overload

Microsoft.SharePoint namespace