ユーザー情報リストのアクセス権を理解する
-
10-12-2019 - |
質問
私はここにいます。コム/ _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.
所属していません sharepoint.stackexchange