I have the following code inside my remote event receiver, where i am trying to remove a user from a list item which have unique permission:-

User oUser = context.Site.RootWeb.EnsureUser(linemanagerUser.LookupValue);

but seems RoleAssignments does not contain RemoveById as in the server-side object module.. so can anyone advice on this please?

Error i got on my above code:-

'RoleAssignmentCollection' does not contain a definition for 'RemoveById' and no accessible extension method 'RemoveById' accepting a first argument of type 'RoleAssignmentCollection' could be found (are you missing a using directive or an assembly reference?)    

1 Answer 1


You can try the below code :

currentItem.RoleAssignments.GetByUser(oUser.Id). DeleteObject () 


   currentItem.RoleAssignments.GetByPrincipal(oUser.Id). DeleteObject () 

For details example, you may refer to the below article :

Remove permission in Sharepoint List using Client Object Model

Your Answer

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

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