Hi, I can't figure out why am I getting this error
"Principal user (Id=xxxxxxxx-0971-e911-a81b-000d3a3b5c20, type=8, roleCount=5, privilegeCount=4532, accessMode=0), is missing prvCreaters_solicitudreservas privilege (Id=xxxxxxxx-22cf-4407-9986-34cc471264e1) on OTC=10585 for entity 'new_logentity'. context.Caller=xxxxxxxx-0971-e911-a81b-000d3a3b5c20. Or identityUser.SystemUserId=xxxxxxxx-c987-e911-a81c-000d3a3b5cdb, identityUser.Privileges.Count=909, identityUser.Roles.Count=2 is missing prvCreaters_solicitudreservas privilege (Id=xxxxxxxx-22cf-4407-9986-34cc471264e1) on OTC=10585 for entity 'new_logentity'." }
I'm Using a JS to create a record on new_logentity (logged as simple user) but I'm impersonating with an user(Admin) and it's unable to create the record? should i add those rights to the normal user?
var userId = "xxxxxxxx-0971-e911-a81b-000d3a3b5c20"; function Create_WebApi(query, obj, behalfAsOtheruser = false) { var req = new XMLHttpRequest(); req.open("POST", Xrm.Page.context.getClientUrl() "/api/data/v9.1/" query, false); if (behalfAsOtheruser) req.setRequestHeader("MSCRMCallerID", userId); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8"); req.send(JSON.stringify(obj)); req.onreadystatechange = function () { if (this.readyState === 4) { req.onreadystatechange = null; if (this.status === 204) { //Success - No Return Data - Do Something return true; } else { //Xrm.Utility.alertDialog(this.statusText); return false; } } }; }
thanks.