@bhaskar : For this Solution we can use only UserId and it work well :)
But if we have to use a loginName
we can do This :
<script src="/SiteAssets/jquery-1.12.3.min.js"></script>
<script src="/SiteAssets/sputility.js"></script>
<script>
$(document).ready(function () {
var userid= _spPageContextInfo.userId;
var requestUri = _spPageContextInfo.webAbsoluteUrl +"/_api/web/getuserbyid("+ userid + ")";
var requestHeaders = { "accept" : "application/json;odata=verbose" };
$.ajax({
url : requestUri,
contentType : "application/json;odata=verbose",
headers : requestHeaders,
success : onSuccess,
error : onError
});
function onSuccess(data, request){
var loginName = data.d.Title;
if(loginName == "xxx") {
SPUtility.GetSPField('yyy').MakeReadOnly();
}
}
function onError(error) {
alert("error");
}
});
</script>