共用方式為


SPRoleAssignmentCollection.AddToCurrentScopeOnly method

新增角色指派在目前的範圍內的角色指派物件的集合。

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

Syntax

'宣告
Public Sub AddToCurrentScopeOnly ( _
    roleAssignment As SPRoleAssignment _
)
'用途
Dim instance As SPRoleAssignmentCollection
Dim roleAssignment As SPRoleAssignment

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

參數

備註

這個方法不會散佈到父範圍的SPRoleType.Guest角色的SPRoleAssignment物件的Member屬性中的安全性主體。如果您想要確保安全性主體有限至少在父範圍中的物件的存取權,您應該呼叫Add(SPPrincipal)方法。

注意事項注意事項

當您呼叫SPRoleAssignmentCollection.Remove方法時,移除作業會影響目前的範圍和所有的子範圍,不論是否SPRoleAssignmentCollection.AddToCurrentScopeOnly方法用來建立任何的領域。

請參閱

參照

SPRoleAssignmentCollection class

SPRoleAssignmentCollection members

Microsoft.SharePoint namespace

Add(SPPrincipal)