/**
* ログインユーザーの管理者フラグの取得
*
*/
function LoginUser() {
debugger;
var manageflg = false;
var loggedInUserId = Xrm.Utility.getGlobalContext().userSettings.userId;
loggedInUserId = loggedInUserId.replace('{', '').replace('}', '');
var globalContext = Xrm.Utility.getGlobalContext();
var globalUrl = globalContext.getClientUrl();
var req = new XMLHttpRequest();
req.open("GET", globalUrl + "/api/data/v9.1/systemusers(" + loggedInUserId + ")?$select=new_manage_flg", false);
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var data = JSON.parse(this.response);
var userexecutive = data.new_manage_flg;
if (userexecutive == 1) {
executiveflg = true;
}
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
return manageflg;
}
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme