This topic has not yet been rated - Rate this topic

SPRoleAssignmentCollection.Add Method (SPPrincipal)

SharePoint 2010

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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
public void Add(
	SPPrincipal principal
)

Parameters

principal
Type: Microsoft.SharePoint.SPPrincipal
An object that represents a security principal (that is, a user or group).

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.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ