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

橙子主题打折出售

其实我不卖,主要是这里是放广告的,所以就放了一个
毕竟主题都没做完,卖了也是坑.

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

热门文章

WordPress 后台编辑器样式实现直接预览 在WordPress3.0以后,有一个新的实用功能:你可以更改默认后台编辑器(TinyMCE)的样...WordPress后台编辑器样式实现直接预览 作者:Pastore Antonio
1451 浏览量
【干货】Chrome插件(扩展)开发全攻略 写在前面我花了将近一个多月的时间断断续续写下这篇博文,并精心写下完整demo,写博客的辛苦大家懂的...【干货】Chrome插件(扩展)开发全攻略 作者:Pastore Antonio
1417 浏览量
CentOS 编译错误+配置错误解决方法集合 ERROR:theHTTPXSLTmodulerequiresthelibxml2/l...CentOS编译错误+配置错误解决方法集合 作者:Pastore Antonio
1410 浏览量
WordPress中加载JavaScript脚本的方法 在WordPress中加载脚本(为CSS和JS,下同)文件,大多数人的做法是直接在hea...WordPress中加载JavaScript脚本的方法 作者:Pastore Antonio
1386 浏览量
wordpress学习五: 通过wordpress_xmlrpc的python包远程操作wordpress wordpress提供了丰富的xmlrpc接口api来供我们远程操控wp的内容。伟大的开源社区有人就...wordpress学习五:通过wordpress_xmlrpc的python包远程操作wordpress 作者:Pastore Antonio
1384 浏览量