Share via


SPRoleAssignmentCollection.AddToCurrentScopeOnly method

Adds a role assignment to the collection of role assignment objects at the current scope.

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

Syntax

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

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

Parameters

Remarks

This method does not propagate the security principal in the Member property of the SPRoleAssignment object to the SPRoleType.Guest role of the parent scopes. If you do want to ensure that the security principal has at least limited access to objects in parent scopes, then you should call the Add(SPPrincipal) method.

Note

When you call the SPRoleAssignmentCollection.Remove method, the remove operation affects the current scope and all sub scopes regardless of whether the SPRoleAssignmentCollection.AddToCurrentScopeOnly method is used to create any of the scopes.

See also

Reference

SPRoleAssignmentCollection class

SPRoleAssignmentCollection members

Microsoft.SharePoint namespace

Add(SPPrincipal)