如何使用REST检索文档权限? [英] How to retrieve document permissions using REST?

查看:55
本文介绍了如何使用REST检索文档权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

在我的SharePoint 2013联机网站集中,每个用户都具有对网站集中所有文档的查看权限.我应该写一个网页,用户可以在其中搜索网站集中的文档.在具有仅查看"权限的搜索结果文档中 将显示为红色,并且具有其他权限(如读取/完全访问权限)的文档将显示为绿色.

In my SharePoint 2013 online site collection every user has view permission to all documents in site collection. I am supposed to write a web page in which user can search through documents in site collection. In search results documents with view only permission will be displayed in red colour and documents with some other permission like read/ full access will be displayed in green colour.

我正在尝试通过REST调用来做到这一点.但是我需要进行迭代的REST调用,以检查每个获取的文档的文档权限.随着文档数量的增加,这将降低性能.我对使用REST调用的批处理请求一无所知. 我们可以在这里使用吗?如果可以,怎么使用?

I am trying to do this with REST call. But I need to do iterative REST calls to check document permissions for every fetched document. This will degrade the performance as document count increases. I do not have any idea about batch requests with REST call. Can we use that here? If yes how to use it?

根据 本文 我们可以将许多操作组合到一个REST调用中.

According to this article we can combine many operations into a single REST call.

有什么方法可以用来获取文档以及与之相关的权限?

Is there any way using which I shall fetch documents along with permissions associated with it?

或者请提出实现此功能的最佳方法.

Or please suggest a best way to achieve this functionality.

谢谢

Pratima Deshpande

Pratima Deshpande

推荐答案

要获得用户对商品的许可,可以使用以下端点.

_ api/web/lists/getbytitle('mydoc3')/items(1)/EffectiveBasePermissions

/_ api/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/getusereffectivepermissions(@user)?@ user ='i%3A0%23.f %7Cmembership%7Cuser%40domain.onmicrosoft.com '

这是供您参考的主题.

https://msdn.microsoft.com /en-us/library/office/dn531433.aspx#bk_ListGetUserEffectivePermissions

最好的问候,

Lee


这篇关于如何使用REST检索文档权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆