【问题标题】:Read Sharepoint online UserProfiles from sharepoint hosted app using JSOM使用 JSOM 从 sharepoint 托管应用程序读取 Sharepoint 在线用户配置文件
【发布时间】:2017-06-22 02:55:12
【问题描述】:

我正在尝试通过参考以下 MSDN 从 sharepoint hostsapp 获取 sharepointonline 用户配置文件

https://dev.office.com/sharepoint/docs/general-development/how-to-retrieve-user-profile-properties-by-using-the-javascript-object-model-in

但是当我尝试执行代码时,它会抛出以下错误“错误:访问被拒绝。您无权执行此操作或访问此资源”。

在上面的文章中,他们提到要输入“domainName\\userName”,这里只是混淆了我应该给我的应用程序域还是我的 sharepointonline 域。

因为我尝试了这两个域,但问题仍然存在。

请大家多多指教……

提前致谢

【问题讨论】:

    标签: sharepoint sharepoint-online user-profile sharepoint-jsom sharepoint-userprofile


    【解决方案1】:

    您的访问被拒绝,因为您的托管应用不需要执行用户配置文件所需的权限。

    在您的 SharePoint 托管应用解决方案 AppManifest.xml 上授予您的应用访问所需的权限。在您的情况下,它将是:

    根据您的使用情况,您可能需要授予它不仅仅是“读取”的权限。

    【讨论】:

    • 谢谢!!,它对我有用
    猜你喜欢
    • 2017-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-23
    • 1970-01-01
    相关资源
    最近更新 更多