I try to update a ListItem in a (foreign) SiteCollection wihtin an edit form by CSOM. But I can't get it to work without getting a 403 error:
cs.updateListItem = function(siteURL, listNameSTR, itemID, propertiesOBJ, successFUN)
{
var ctxOBJ = new SP.ClientContext(siteURL);
var listOBJ = ctxOBJ.get_web().get_lists().getByTitle(listNameSTR);
var itemOBJ = listOBJ.getItemById(itemID);
for(var propertySTR in propertiesOBJ) {
itemOBJ.set_item(propertySTR, propertiesOBJ[propertySTR]);
}
itemOBJ.update();
ctxOBJ.executeQueryAsync(
Function.createDelegate(this, successFUN),
Function.createDelegate(this, function(senderOBJ, argsOBJ){console.log(argsOBJ.get_message() + "\n" + argsOBJ.get_stackTrace());})
);
}
I also tried the same with a REST call...
- Its not the Security Token/Digest (tried that in different ways)
- It's not the user permissions (I tried even with farm admin)
- Within the current site collection it works
- it works if I fire the script on every other site, it only crashes within the form
- I created a new plain vanilla site collections on a plain vanilla SharePoint
- I tried different SharePoint releases of the last 12 months
There is always a 403...
this is very strange