0

I have the following code inside my remote event receiver (which run on item added):-

 using (ClientContext context = TokenHelper.CreateRemoteEventReceiverClientContext(properties))
            {
              currentItem["OrderAssignToApprover2"] = new FieldUserValue() { LookupId = spUser.Id };
              currentItem.SystemUpdate();

now if a non-admin user add an item then the remote event receiver will raise this error on the SystemUpdate():-

Access denied. You do not have permission to perform this action or access this resource.

but if admin user add an item then the remote event receiver will works fine OR if i change the remote event reicever to run using App Permsion, as follow:-

using (ClientContext context = Helpers.GetAppOnlyContext(properties.ItemEventProperties.WebUrl))
            {
              currentItem["OrderAssignToApprover2"] = new FieldUserValue() { LookupId = spUser.Id };
              currentItem.SystemUpdate();

so can i assume that the SystemUpdate() (unlike Update()) require the user to have full control on the site?If this is the case then is there a way to allow non-admin users to execute SystemUpdate()? Thanks

5
  • 1
    Does the non-admin user has full control permissions on list item? May 28, 2020 at 4:46
  • @GaneshSanap no they have contribute permission only
    – John John
    May 28, 2020 at 9:22
  • I think in order to use the SystemUpdate() user should have at least edit permissions on the list and list item. try giving edit permissions on list to user and let me know if this works. May 28, 2020 at 9:24
  • @GaneshSanap i do not want to grant non-admin users Edit, they should only have contribute
    – John John
    May 28, 2020 at 12:50
  • According to this, to update the item using JSOM/CSOM using system update requires at least edit permission. May 28, 2020 at 13:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.