SPRole.AddUser method (String, String, String, String)

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 user specified by user name, e-mail address, display name, and notes 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 ( _
    loginName As String, _
    email As String, _
    name As String, _
    notes As String _
)
'Usage
Dim instance As SPRole
Dim loginName As String
Dim email As String
Dim name As String
Dim notes As String

instance.AddUser(loginName, email, name, _
    notes)
[ObsoleteAttribute("Use the SPRoleDefinition class instead")]
public void AddUser(
    string loginName,
    string email,
    string name,
    string notes
)

Parameters

  • loginName
    Type: System.String

    A string that contains the user name (DOMAIN\User_Alias).

See also

Reference

SPRole class

SPRole members

AddUser overload

Microsoft.SharePoint namespace