Initializes a new instance of the SPSite class based on the specified site collection GUID, URL zone, and user token.
命名空间: Microsoft.SharePoint
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Sub New ( _
id As Guid, _
zone As SPUrlZone, _
userToken As SPUserToken _
)
用法
Dim id As Guid
Dim zone As SPUrlZone
Dim userToken As SPUserToken
Dim instance As New SPSite(id, zone, _
userToken)
public SPSite(
Guid id,
SPUrlZone zone,
SPUserToken userToken
)
参数
id
类型:System.GuidA GUID that specifies the site collection.
zone
类型:Microsoft.SharePoint.Administration.SPUrlZoneAn SPUrlZone value that specifies the URL zone.
userToken
类型:Microsoft.SharePoint.SPUserTokenAn SPUserToken object that represents the user token.
备注
SPSite objects that are created with a user token run in the context of the specified user. It is not possible to change the user context of an SPSite object once it has been created. Switching users requires creating a new SPSite object.
The user token is transferable across site collections, but not across identity management systems. For example, pluggable membership and role providers making a request must match the provider on the resource side.
Use the UserToken property to get the user token that is associated with any SPUser object, not just the current user. If the requested user is not the current user, SharePoint Foundation builds the token from the security identifier (SID) of the user and gets the group membership information using the authorization object model (see SharePoint 2013 中的授权、用户、组和对象模型).