0

I am working on a remote event receiver inside SharePoint online custom list. now inside the RER i am getting the item been updated, then reset its role inheritance + add users to the item permission, as follow:-

projectItem.ResetRoleInheritance();
projectItem.BreakRoleInheritance(false, false);
projectItem.RoleAssignments.Add(oUser, new RoleDefinitionBindingCollection(context) { readerDef });
FieldUserValue[] approvers = projectItem["Approvers"] as FieldUserValue[];
                    foreach (FieldUserValue user in approvers)
                            {
                              User oUser2 = context.Web.EnsureUser(user.LookupValue);
                              context.Load(oUser2);
                              context.ExecuteQuery();
                              projectItem.RoleAssignments.Add(oUser2, new RoleDefinitionBindingCollection(context) { contributeDef });

                             }

now i thought to get the ListItem.ResetRoleInheritance() + ListItem.RoleAssignments.Add() working i need to execute ListItem.Update() at the end.. but based on my test the ListItem.ResetRoleInheritance() + ListItem.RoleAssignments.Add() will be applied without having to execute ListItem.Update().. so is my assumption correct? Thanks

1

There is no need to add ListItem.Update() when use reset listItem permission.

Official document about ListItem.Update() for your reference:

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-server/ee536748(v=office.15)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.