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
1542 浏览量
【干货】Chrome插件(扩展)开发全攻略 写在前面我花了将近一个多月的时间断断续续写下这篇博文,并精心写下完整demo,写博客的辛苦大家懂的...【干货】Chrome插件(扩展)开发全攻略 作者:Pastore Antonio
1497 浏览量
C#图片处理 通常对一幅图片的处理包括:格式变换,缩放(Scale),翻转(Rotate),截取(Clip),滤镜...C#图片处理 作者:Pastore Antonio
1492 浏览量
memcached 处理 多端口:https://blog.csdn.net/Erica_1230/article/deta...memcached处理 作者:Pastore Antonio
1491 浏览量
Windows 休眠 浏览量:1,548 作者:Pastore Antonio
1475 浏览量