문제

여기에 사용자 정보 목록 ( http : // domainname)에 대한 세부 정보를 얻으 려합니다.com / _catalogs / users / 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 ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top