SPRoleAssignmentCollection.Add method (SPRoleAssignment)

Adds a role assignment to the collection of role assignment objects.

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

Syntax

'Declaration
Public Sub Add ( _
    roleAssignment As SPRoleAssignment _
)
'Usage
Dim instance As SPRoleAssignmentCollection
Dim roleAssignment As SPRoleAssignment

instance.Add(roleAssignment)
public void Add(
    SPRoleAssignment roleAssignment
)

Parameters

Remarks

This method fails if the collection already contains a role assignment for the security principal specified in the Member property of roleAssignment.

This method ensures that the security principal in the Member property of roleAssignment has at least SPRoleType.Guest access to objects in all parent scopes. To limit the access of the security principal to objects only in the current scope, call the AddToCurrentScopeOnly(SPRoleAssignment) method.

See also

Reference

SPRoleAssignmentCollection class

SPRoleAssignmentCollection members

Add overload

Microsoft.SharePoint namespace