CSOM:
SPDocumentSharingManager 成員
GetDocumentLink | ||
GetRoleDefinitionFromWeb | 獲取與給定的角色枚舉值關聯的 web 角色定義。 | |
GetRoleDefinitionIdFromWeb | 獲取與給定的角色枚舉值關聯的 web 角色定義 ID。 | |
IsDocumentSharingEnabled | 檢查文檔庫中是否已啓用文檔共享。 | |
SetDocumentLink | ||
SetDocumentSharingEnabled | 設置是否應在文檔庫啓用文檔共享。 | |
UpdateDocumentSharingInfo | 包含用作參數以初始化 |
SPDocumentSharingManager.UpdateDocumentSharingInfo 方法
public static List<UserSharingResult> UpdateDocumentSharingInfo( string resourceAddress, List<UserRoleAssignment> userRoleAssignments, bool validateExistingPermissions, bool additiveMode, bool sendServerManagedNotification, string customMessage, bool includeAnonymousLinksInNotification )
參數
- resourceAddress
- 類型:System.String
URL 指向的可保護對象 (文檔、 文件夾或文檔庫的根文件夾)。
- userRoleAssignments
- 類型:System.Collections.Generic.List<UserRoleAssignment>
收件人和爲依據來分配這些安全對象上的角色的列表。
- validateExistingPermissions
- 類型:System.Boolean
- additiveMode
- 類型:System.Boolean
一個布爾型標誌指示的權限設置是否使用加法或嚴格模式: 真-累加性 ;false — 嚴格。
- sendServerManagedNotification
- 類型:System.Boolean
一個標誌,指示服務器生成電子郵件通知如果 SharePoint 服務器上配置電子郵件服務器。
- customMessage
- 類型:System.String
自定義要包括在電子郵件通知中的消息
- includeAnonymousLinksInNotification
- 類型:System.Boolean
Boolean 標誌,用於指示是否包括匿名訪問通知郵件中的鏈接: 真是指包括 ;false 表示不包含。
返回值
類型:System.Collections.Generic.List<UserSharingResult>一個DocumentSharingResult對象,該對象包含用戶爲每個收件人共享結果
JSOM:
https://msdn.microsoft.com/zh-cn/library/office/jj838523.aspx
SP。Sharing.DocumentSharingManager 對象 (sp.js)
var object = new SP.Sharing.DocumentSharingManager()
DocumentSharingManager對象具有以下成員。
構造函數
DocumentSharingManager對象具有以下構造函數。
構造函數 |
說明 |
---|---|
Initializes a new instance of the SP.Sharing.DocumentSharingManager object. |
方法
DocumentSharingManager對象具有以下方法。
方法 |
說明 |
---|---|
Gets the role definition that is associated with a given Role enum value. |
|
Checks if document sharing is enabled on a document library. |
|
Allows a user to update a document's sharing info. |
SP.Sharing.DocumentSharingManager.updateDocumentSharingInfo 方法 (sp.js)
注意:其參數與CSOM形式一樣var roleAssignment = new SP.Sharing.UserRoleAssignment();
roleAssignment.set_role(modelObject.CompetenceID);
roleAssignment.set_userId(modelObject.YGUISPAccount);
userRoleAssignments.push(roleAssignment);
SP.Sharing.DocumentSharingManager.updateDocumentSharingInfo(clientContext, modelObject.ResourceAddress, userRoleAssignments, false, false, false, "Please look at the following document", false);