获取Sharepoint站点用户:电子邮件和角色 [英] Getting Sharepoint site users: e-mails and role

查看:72
本文介绍了获取Sharepoint站点用户:电子邮件和角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想获得一个可以访问Sharepoint站点的用户/组列表。除了用户列表和相应的电子邮件之外,我还想知道用户对网站的访问级别( Full
Control
,  编辑,  Contribute
等。)



我已经能够通过使用SiteUsers获取一些数据:
https://my-company.sharepoint.com/sites/Testsite/_api/Web/SiteUsers
 ,可以解析JSON元素。我能够获取用户名和电子邮件,但我不知道如何从这里获取访问级别(角色?)。是否有更好的REST API来获取这些数据?

解决方案


你可以试试这个:

 _api /网络

选择= RoleAssignments /会员/ LoginName将,RoleAssignments / RoleDefinitionBindings /名称&安培;?

扩大= RoleAssignments /会员,RoleAssignments / RoleDefinitionBindings

此外,这里有一些类似的帖子供您参考:


https://social.msdn.microsoft.com/Forums/vstudio/en-US/e89ca6b5-3423-4cb1-b318-64c113 298009 / get-the-users-permission-level-at-site-forum = sharepointdevelopment


https://sharepoint.stackexchange.com/questions/199409/how-to-get- users-permission-on-sharepoint-site-with-rest-api / 199410


最好的问候,


Michael Han


I would like to get a list of users/groups that have access to a Sharepoint site. In addition to the list of users and respective e-mails, I'd like to know what level of access the user has to the site (Full ControlEditContribute, etc).

I've been able to get some data by using SiteUsers: https://my-company.sharepoint.com/sites/Testsite/_api/Web/SiteUsers and can parse JSON elements. I'm able to get the user names and e-mails, but I don't see how to get the access level (role?) from here. Is there a better REST API to get this data?

解决方案

Hi,

You could try this:

_api/web?


select=RoleAssignments/Member/LoginName,RoleAssignments/RoleDefinitionBindings/Name&


expand=RoleAssignments/Member,RoleAssignments/RoleDefinitionBindings

Besides, here are some similar posts for your reference:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/e89ca6b5-3423-4cb1-b318-64c113298009/get-the-users-permission-level-at-the-site?forum=sharepointdevelopment

https://sharepoint.stackexchange.com/questions/199409/how-to-get-users-permission-on-sharepoint-site-with-rest-api/199410

Best Regards,

Michael Han


这篇关于获取Sharepoint站点用户:电子邮件和角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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