SPRoleAssignmentCollection.Add method (SPPrincipal)

Creates a new role assignment for a specified security principal and gives the security principal guest access to objects in the current scope and in all parent scopes.

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

Syntax

'Declaration
Public Sub Add ( _
    principal As SPPrincipal _
)
'Usage
Dim instance As SPRoleAssignmentCollection
Dim principal As SPPrincipal

instance.Add(principal)
public void Add(
    SPPrincipal principal
)

Parameters

Remarks

When this method is called, a new SPRoleAssignment object is created in the collection; the specified security principal is assigned as the value of the Member property; and the role definition for the role type SPRoleType.Guest is added to the RoleDefinitionBindings collection of the object.

See also

Reference

SPRoleAssignmentCollection class

SPRoleAssignmentCollection members

Add overload

Microsoft.SharePoint namespace

RoleDefinitions

SPRoleType