Forum Discussion

cmaynie's avatar
cmaynie
Copper Contributor
Mar 13, 2019

Check all files when a folder is deleted !

In a SharePoint document library, in Office 365, a user can delete a folder if he has the collaborate rules in it. So it's, but if there is one more files int it without permission for this user, this one can delete the folder and all files ares saved in it.
It's necessary to prevent massive deletion and human error, to inform or block the user, when he delete a folder which contain files with no permission for he.

4 Replies

  • Naveen Karla's avatar
    Naveen Karla
    Iron Contributor

    Did you look at remote event receivers to check for user permissions before folder can be deleted? Maybe custom is the only option here. 

    https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-remote-event-receivers-in-sharepoint

    https://sharepoint.stackexchange.com/questions/248591/stop-item-from-being-deleted-with-remote-event-receiver-in-sharepoint-online

     

  • Unfortunately SharePoint does not provide a builtin mechanism to prevent massive deletions in a folder in a scenario such as the one you have just described
    • Sai Gutta's avatar
      Sai Gutta
      Iron Contributor

      cmaynie - Very good question.

       

      jcgonzalezmartin - So a file with unique permissions within a folder can be deleted when the folder is deleted, even when the user who is deleting the folder doesn't have permissions to that file ?

Resources