Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
SharePoint 2010
SDK Documentation
Core Class Library
 AddToCurrentScopeOnly Method
Community Content
In this section
Statistics Annotations (2)
Collapse All/Expand All Collapse All
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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Visual Basic (Declaration)
Public Sub AddToCurrentScopeOnly ( _
    roleAssignment As SPRoleAssignment _
)
Visual Basic (Usage)
Dim instance As SPRoleAssignmentCollection
Dim roleAssignment As SPRoleAssignment

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

Parameters

roleAssignment
Type: Microsoft.SharePoint..::.SPRoleAssignment
The role assignment to add.

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.

NoteNote

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.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
How to add group with Limited Access permission?      Smartin75   |   Edit   |   Show History
Document related to FGP (http://www.microsoft.com/download/en/details.aspx?id=9030) says: When users are added to individual scopes under the Web level, using the new SharePoint 2010 Products SPRoleAssignmentCollection.AddToCurrentScopeOnly method, they can also then be added, by additional code, to the new group that has already been established as having Limited Access rights at the Web and document library level.

How to add group with Limited Access rights? Create your own permission level (My Limited Access). Detailed description can be found here: http://www.martinhatch.com/2011/10/scaling-to-10000-unique-permissions_04.html
Tags What's this?: Add a tag
Flag as ContentBug
SPRoleAssignmentCollection.Remove operation and how it affects scope      Siew Moi Khor - MSFT   |   Edit   |   Show History
Note that 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.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker