Forum Discussion

john john's avatar
john john
Iron Contributor
Aug 21, 2023

Can we create a remote event receiver to prevent users from deleting files but allow them to rename

We created a custom permission level which mimic the built-in Contribute permission level but without the ability to delete items and versions, by unchecking those 2 checkboxes:-

 

 

 

Our intention was to prevent users from moving folders and deleting folders, but currently users cannot rename files also. So does anyone face this issue? and have any solution for it? not sure if remote event receivers might be an approach to invest in to solve this issue (prevent users from deleting files but allow them to rename the files)?

8 Replies

  • Hi,

    Remote Event Receivers can be considered as a legacy dev technique that is recommended not to use

    • john john's avatar
      john john
      Iron Contributor

      jcgonzalezmartin 

      Not sure if this is the case really.. as for any built-in SharePoint list or library it comes with many built-in remote event receivers... you can check them using Get-PnPEventRecevier command.

       

      Second point, if remote event receivers should not be used as you mentioned, then what is the relevant replacement for it , to perform action related to itemadding, itemupdating and itemdeleting ??

       

      Can you advice on the above 2 points?

       

      Thanks

      • Hi
        My comments:
        (1) Of course, Microsoft as owner of SharePoint Online can have Remote Event Receivers there that at some point can be replaced, they have still farm solutions, features, etc.
        (2) Replacements: Power Automate Flows, Webhooks, Azure Functions

Resources