I have Read User having read Permission.
I'm trying to update the list item using JSOM. But I get below error
"Access denied. You do not have permission to perform this action or access this resource."
try {
var list = clientContext.get_site().get_rootWeb().get_lists().getByTitle("ListName");
var reportListItem = list.getItemById(CommentId);
reportListItem.set_item('Reported_Flag', '1');
reportListItem.set_item('Report_Comment', commentText);
reportListItem.update();
clientContext.executeQueryAsync(function () {
$('#reportModal textarea').val("");
$("#reportModal").modal("hide");
}, function (xhr, textStatus, errorThrown) {
ULS.enable = true
ULSOnError(" - Unable to get report the comment in Comments list - " + textStatus + errorThrown, location.href, 0)
});
}
catch (error) {
console.log(" - " + error.message);
ULS.enable = true;
ULSOnError(" - " + error.message, location.href, 0);
}
Read
permission. You need to elevate the permission toWrite
on the list at least. Also, if you are going to be doing this on multiple lists, would make sense to giveFull control
on the web.