简体   繁体   English

Sharepoint 2013访问被拒绝。 您没有执行此操作或访问此资源的权限。 -get_siteGroups()

[英]Sharepoint 2013 Access denied. You do not have permission to perform this action or access this resource. - get_siteGroups()

Here is my Javascript code to get all the users from a sharepoint 2013 (office 365). 这是我的Javascript代码,用于从共享点2013(办公室365)获取所有用户。 But I get a error what I don't have permissions. 但是我没有权限,但出现错误。 Am I missing a trick? 我错过了一个把戏吗?

It is used in a sharepoint hosted APP. 它在SharePoint托管的APP中使用。

    function retrieveAllUsersAllGroups() {

    var clientContext = Context;
    this.collGroup = clientContext.get_web().get_siteGroups();
    clientContext.load(collGroup);
    clientContext.load(collGroup, 'Include(Users)');

    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}

function onQuerySucceeded() {

    var userInfo = '';

    var groupEnumerator = collGroup.getEnumerator();
    while (groupEnumerator.moveNext()) {
        var oGroup = groupEnumerator.get_current();
        var collUser = oGroup.get_users();
        var userEnumerator = collUser.getEnumerator();
        while (userEnumerator.moveNext()) {
            var oUser = userEnumerator.get_current();
            this.userInfo += '\nGroup ID: ' + oGroup.get_id() +
                '\nGroup Title: ' + oGroup.get_title() +
                '\nUser: ' + oUser.get_title() +
                '\nLogin Name: ' + oUser.get_loginName();
        }
    }

    alert(userInfo);
}

function onQueryFailed(sender, args) {

    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

使用PersonProperties对象获取有关SharePoint用户的信息,例如显示名称,电子邮件,标题以及其他业务和个人信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您无权访问此资源。 此外,遇到了 403 Forbidden 错误 - You don't have permission to access this resource. Additionally, a 403 Forbidden error was encountered Forbidden 您无权访问此资源。 Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.2.34 服务器在 localhost 端口 80 - Forbidden You don't have permission to access this resource. Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.2.34 Server at localhost Port 80 ContactsApp.createContact()您无权执行该操作 - ContactsApp.createContact() You do not have permission to perform that action 如何在发布我的自定义 vscode 扩展时修复“拒绝访问以执行此操作:查看资源的用户权限” - How to fix “ Access Denied to perform this action: View user permissions on a resource” while publishing my custom vscode extension 拒绝访问 您无权访问 Selenium Python 中的站点 - Access Denied You don't have permission to access site in Selenium Python 拒绝访问受限制的URI。 萤火 - Access to restricted URI denied. Firebug chrome.tabs不可用:您无权访问此API - chrome.tabs is not available: You do not have permission to access this API SharePoint 2013 API jQuery.Ajax访问被拒绝 - SharePoint 2013 API jQuery.Ajax Access Denied SuiteCRM 中的 JOIN 子查询错误 40,(“名称”:“拒绝访问”,“编号”:40,“说明”:“您无权访问”) - JOIN subquery in suiteCRM Error 40, ("name":"Access Denied","number":40,"description":"You do not have access") javascript-所请求的资源上没有“ Access-Control-Allow-Origin”标头。 我不知道该怎么办 - javascript - No 'Access-Control-Allow-Origin' header is present on the requested resource. i dont know what to do
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM