Logo

SharePoint 文件共享 CSOM|JSOM

photo

2022年06月12日

CSOM:

https://msdn.microsoft.com/zh-cn/library/office/microsoft.sharepoint.sharing.spdocumentsharingmanager.updatedocumentsharinginfo.aspx

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对象具有以下构造函数。

构造函数

说明

DocumentSharingManager

Initializes a new instance of the SP.Sharing.DocumentSharingManager object.

方法

DocumentSharingManager对象具有以下方法。

方法

说明

getRoleDefinition

Gets the role definition that is associated with a given Role enum value.

isDocumentSharingEnabled

Checks if document sharing is enabled on a document library.

updateDocumentSharingInfo

Allows a user to update a document’s sharing info.

SP.Sharing.DocumentSharingManager.updateDocumentSharingInfo 方法 (sp.js)

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);

所有附件
该文章没有附件.
本文为原创文章,请注意保留出处!

热门文章

修复群晖Synology Drive client右键菜单缺失问题 本教程主要解决windows10右键菜单中没有SynologyDrive菜单的问题,整体思路是找到...修复群晖SynologyDriveclient右键菜单缺失问题 作者:Pastore Antonio
1825 浏览量
docker如何查看一个镜像内部的目录结构及其内部都有哪些文件 前言:有时候我们会在docker上下载一个镜像,或者是上传一个镜像到docker上,甚至有时候就是在...docker如何查看一个镜像内部的目录结构及其内部都有哪些文件 作者:Pastore Antonio
1806 浏览量
configure: error: Package requirements (oniguruma) were not met configure:error:Packagerequirements(oniguruma)...configure:error:Packagerequirements(oniguruma)werenotmet 作者:Pastore Antonio
1534 浏览量
Adobe Acrobat Pro 激活 这里记录了一些AdobeAcrobat的激活教程和组件。浏览量:1,687 作者:Pastore Antonio
1533 浏览量
追寻日出,找回自己 为什么我要去追寻日出?其实我是一个很懒的人,每次都起不来,直到有一次我在租房中睡到了大天亮,阳光照...追寻日出,找回自己 作者:Pastore Antonio
1514 浏览量