我在这里获取有关用户信息列表的一些详细信息(在 http:// domainname。com / _catalogs / userse / simple.aspx ),我在互联网上找到了它。

因为它在_catalogs下可用,只有管理员才能访问列表,也会发生在我身上。

但是当我在内容编辑器中放入一些脚本并将页面放到一个刚刚在网站上读取权限的人中时,脚本获取了数据。

下面是我使用的脚本:

<script type="text/ecmascript" language="ecmascript">
    ExecuteOrDelayUntilScriptLoaded(getProfile, "sp.js");
    var _spUserId="domain\ID"
    var context = null;
    var web = null;    

    function getProfile() {
    alert(_spUserId);
        context = SP.ClientContext.get_current();
        web = context.get_web();
        userInfoList = web.get_siteUserInfoList();
        camlQuery = new SP.CamlQuery();
        camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'Name\'/><Value Type=\'Text\'>' + _spUserId + '</Value></Eq></Where></Query><RowLimit>1</RowLimit></View>');
        this.listItems = userInfoList.getItems(camlQuery);
        context.load(listItems);
        context.executeQueryAsync(Function.createDelegate(this, this.onProfileSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
    }

    function onProfileSuccessMethod(sender, args) {
        var item = listItems.itemAt(0);
        var tit = item.get_item('Title');
        if (tit) {
           alert(tit);
        } 
    }

    function onFailureMethod(sender, args) {
        alert('Error: ' + args.get_message() + '\n' + args.get_stackTrace());
    }
</script>
.

请有些人可以向我解释一下,因为我非常困惑。

有帮助吗?

解决方案

Users have permission to read other users details. If you take the non-admin user, and have them click on a user name someone in SharePoint, like the Modified by of a list item, the user can view the editors profile. The actual list view, or URL in _catalogs, might be restricted, but the data within is not.

许可以下: CC-BY-SA归因
scroll top