Forum Discussion
Prevent deletion of SharePoint files
- Jul 05, 2019You need to create a new permission role and assign that to users. Go to the SharePoint site permissions, it's under advanced on the home page. Add a role and select just the permissions the user needs and not delete. Now go to library and change the user group permissions to that new role.
Great tip. Noticed one drawback though. The ability to rename files is linked to the Delete permission. When you remove the Delete permission, the user can't rename files anymore either.
- Alan MarshallAug 11, 2019Iron ContributorThat should only require edit rights as it's a property. Maybe someone at Microsoft can confirm this.
- SengyoAug 11, 2019Copper Contributor
Sure, with the Edit right, you can edit the file or modify its metadata no problem. However, by renaming it, it seems the system must delete one version to re-create the new version with the new name. This must be done with the Delete right.
There has been some discussion on that:
https://sharepoint.stackexchange.com/questions/255781/permission-level-which-doesnt-allow-renaming-file-in-document-library
Forced me to do a few acrobatics in my application cause I wanted to prevent users from deleting their files (and those contributed by others) but also allow them to rename the file.
R.