SOLVED
Home

Prevent deletion of SharePoint files

%3CLINGO-SUB%20id%3D%22lingo-sub-738912%22%20slang%3D%22en-US%22%3EPrevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-738912%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20had%20a%20situation%20where%20an%20end%20user%20accidentally%20deleted%20thousands%20for%20files%20under%20a%20SharePoint%20document%20library%20via%20OneDrive.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20document%20library%20itself%20is%20accessible%20to%20everyone%20within%20the%20company.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20prevent%20users%20from%20deleting%20files%20within%20a%20document%20library%20and%20all%20subfolders%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20users%20currently%20have%20%22Edit%22%20permissions%20allowing%20users%20to%20add%2C%20update%20and%20delete%20all%20items.%20There%20doesn't%20appear%20to%20be%20a%20permission%20level%20that%20allows%20all%20this%20except%20for%20delete.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20945px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F122253iFC77051A43F6C388%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-07-05_12-23-13.png%22%20title%3D%222019-07-05_12-23-13.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-738912%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOneDrive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-740247%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-740247%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371336%22%20target%3D%22_blank%22%3E%40telecaster%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20believe%20that%20is%20possible%20with%20out%20of%20the%20box%20permissions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20an%20additional%20document%20library%20with%20read%20only%20permissions%20reasonable%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20this%20helps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENorm%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-740500%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-740500%22%20slang%3D%22en-US%22%3EYou%20need%20to%20create%20a%20new%20permission%20role%20and%20assign%20that%20to%20users.%20Go%20to%20the%20SharePoint%20site%20permissions%2C%20it's%20under%20advanced%20on%20the%20home%20page.%20Add%20a%20role%20and%20select%20just%20the%20permissions%20the%20user%20needs%20and%20not%20delete.%20Now%20go%20to%20library%20and%20change%20the%20user%20group%20permissions%20to%20that%20new%20role.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-740520%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-740520%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F180%22%20target%3D%22_blank%22%3E%40Alan%20Marshall%3C%2FA%3E~%20Thanks%20for%20pointing%20that%20out.%20I%20forgot%20that%20was%20possible.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371336%22%20target%3D%22_blank%22%3E%40telecaster%3C%2FA%3E%26nbsp%3B~%20Sorry%20if%20I%20led%20you%20astray.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-741726%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-741726%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F180%22%20target%3D%22_blank%22%3E%40Alan%20Marshall%3C%2FA%3EThanks%20for%20your%20help%2C%20much%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20setting%20is%20under%20Site%20settings%20%26gt%3B%20Site%20permissions%20%26gt%3B%20Permission%20levels.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20535px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F122496iB2BC15CA3917C57A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-07-08_13-06-15.png%22%20title%3D%222019-07-08_13-06-15.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-798600%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-798600%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F180%22%20target%3D%22_blank%22%3E%40Alan%20Marshall%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreat%20tip.%26nbsp%3B%20Noticed%20one%20drawback%20though.%26nbsp%3B%20The%20ability%20to%20rename%20files%20is%20linked%20to%20the%20Delete%20permission.%26nbsp%3B%20When%20you%20remove%20the%20Delete%20permission%2C%20the%20user%20can't%20rename%20files%20anymore%20either.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-799208%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-799208%22%20slang%3D%22en-US%22%3EThat%20should%20only%20require%20edit%20rights%20as%20it's%20a%20property.%20Maybe%20someone%20at%20Microsoft%20can%20confirm%20this.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-799257%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-799257%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F180%22%20target%3D%22_blank%22%3E%40Alan%20Marshall%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESure%2C%20with%20the%20Edit%20right%2C%20you%20can%20edit%20the%20file%20or%20modify%20its%20metadata%20no%20problem.%26nbsp%3B%20However%2C%20by%20renaming%20it%2C%20it%20seems%20the%20system%20must%20delete%20one%20version%20to%20re-create%20the%20new%20version%20with%20the%20new%20name.%26nbsp%3B%20This%20must%20be%20done%20with%20the%20Delete%20right.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20has%20been%20some%20discussion%20on%20that%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F255781%2Fpermission-level-which-doesnt-allow-renaming-file-in-document-library%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F255781%2Fpermission-level-which-doesnt-allow-renaming-file-in-document-library%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EForced%20me%20to%20do%20a%20few%20acrobatics%20in%20my%20application%20cause%20I%20wanted%20to%20prevent%20users%20from%20deleting%20their%20files%20(and%20those%20contributed%20by%20others)%20but%20also%20allow%20them%20to%20rename%20the%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ER.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800401%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800401%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F180%22%20target%3D%22_blank%22%3E%40Alan%20Marshall%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20agree%20but%20users%20always%20need%20to%20delete%20the%20files%2C%20you%20just%20need%20to%20train%20them%20also%20you%20are%20able%20to%20recover%20all%20the%20files%20after%20deletion.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-834491%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-834491%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371336%22%20target%3D%22_blank%22%3E%40telecaster%3C%2FA%3E%26nbsp%3B%20I'm%20not%20seeing%20the%20Manage%20options%20on%20our%20SharePoint%20sites.%26nbsp%3B%20We%20are%20on%20a%20Government%20Tenant%2C%20so%20I'm%20wondering%20if%20that%20feature%20just%20isn't%20available%20yet%20or%20if%20it%20is%20something%20we%20can%20add%20to%20the%20menu.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F129787i6006BB8C2E0C4DDD%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_0.png%22%20title%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-834531%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-834531%22%20slang%3D%22en-US%22%3EYou%20are%20right.%20I%20used%20Views%20to%20prevent%20users%20from%20deleting%20files%20from%20others.%20The%20ability%20to%20recover%20after%20deleting%20a%20file%20is%20also%20reassuring.%20Thanks.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1020530%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1020530%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371336%22%20target%3D%22_blank%22%3E%40telecaster%3C%2FA%3E%26nbsp%3BI%20am%20also%20facing%20this%20same%20issue%20in%20that%20I'd%20like%20to%20prevent%20users%20from%20deleting%20files.%26nbsp%3B%20However%2C%20it%20also%20seems%20to%20prevent%20their%20being%20able%20to%20move%20files.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ECould%20someone%20please%20confirm%20for%20me%20those%20two%20are%20also%20related.%26nbsp%3B%20Also%2C%20what%20else%20might%20be%20affected%20if%20you%20do%20not%20allow%20delete%3F%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EAnyone%20know%20of%20a%20User%20Voice%20to%20vote%20for%20this%20option.%26nbsp%3B%20It%20seems%20to%20be%20a%20frequent%20request%20--%20to%20prevent%20delete%20but%20allow%20other%20options.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance%20for%20your%20help%2C%20everyone!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1170887%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1170887%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371336%22%20target%3D%22_blank%22%3E%40telecaster%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20an%20Admin%20of%20our%20SharePoint%20instance%2C%20but%20I%20do%20have%20the%20ability%20to%20create%20sub%20sites.%20I%20can%E2%80%99t%20create%20my%20own%20unique%20permissions%20either.%20I%20have%20to%20work%20within%20the%20defaults%20I%E2%80%99m%20provided.%20I%20also%20don%E2%80%99t%20want%20the%20Users%20deleting%20their%20folders%20on%20which%20they%20can%20Contribute%20as%20all%20the%20permissions%20on%20the%20folder%20go%20with%20the%20folder%20and%20it%E2%80%99s%20a%20headache%20to%20fix%20-%20maybe%20even%20detrimental%20depending%20on%20what%20files%20are%20lost%20and%20the%20retention%20policies%20in%20place.%20The%20%E2%80%9Ccan%E2%80%99t%20be%20done%E2%80%9D%20answer%20is%20less%20appealing%20to%20me%20than%20a%20slightly%20tedious%20solution%20that%20works.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20option%20to%20consider%20trying%20-%20that%20works%20for%20me%20-%20is%20to%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.)%20Place%20a%20tiny%20txt%20file%20in%20the%20Member%20(User)%20%5Bor%20Group%20folder%5D%20and%20then%20as%20Owner%20%E2%80%9CDo%20not%20share%E2%80%9D%20the%20txt%20file%20so%20it%20is%20only%20visible%20to%20the%20Owner.%20In%20other%20words%2C%20the%20Owner%20has%20Full%20Control%20on%20the%20txt%20file%2C%20and%20no%20one%20else%20has%20any%20access%20-%20therefore%20they%20don%E2%80%99t%20even%20see%20it%20in%20their%20folder%20on%20which%20they%20have%20Contribute%20permission.%20Then%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.)%20Right-click%20on%20the%20txt%20file%20as%20Owner%20and%20%E2%80%9CCheck%20out%E2%80%9D%20the%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%E2%80%99s%20a%20bit%20of%20a%20hack%2C%20but%20if%20the%20Member%20with%20Contribute%20rights%20tries%20to%20delete%20the%20folder%20either%20intentionally%20or%20by%20accident%26nbsp%3B(even%20when%20appearing%20empty)%20they%20will%20be%20told%20the%20folder%20has%20a%20file%20checked%20out%20for%20editing%20and%20they%20can%20not%20delete%20the%20folder.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EIf%20you%20have%20sub%20folders%20within%20the%20folder%20you%20wish%20retained%2C%20then%20placing%20this%20_.txt%20or%20do_not_delete.txt%20file%20in%20the%20sub%20folder%20will%20prevent%20easy%20deletion%20of%20both%20the%20sub%20folder%20and%20(all%20enclosing)%20folder(s).%26nbsp%3BThe%20Member%E2%80%99s%20file%20actions%20(i.e.%2C%20create%2C%20rename%2C%20delete%2C%20etc.)%20on%20their%20own%20files%20are%20otherwise%20unaffected%20as%20only%20the%20txt%20file%E2%80%99s%20access%20is%20impacted.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EThe%20obvious%20downside%20is%20this%20%E2%80%9Dfix%E2%80%9D%20takes%20clicks%20within%20each%20User%20%E2%80%9CContribute%E2%80%9D%20folder%2C%20but%20depending%20on%20the%20number%20of%20Users%20and%20folders%20the%20Owner%20has%20within%20the%20site%2C%20it%20may%20be%20worth%20the%20time%20spent%20and%20help%20you%20rest%20easier%20knowing%20the%20folder%E2%80%98s%20aren't%20easily%20deleted.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EIf%20you%20have%20Admin%20control%20over%20the%20site%20I%20imagine%20you%20should%20be%20able%20to%20come%20up%20with%20a%20better%20way%20(i.e.%2C%20faster%20and%20less%20tedious%20way)%20to%20achieve%20the%20same%20outcome.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1305859%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1305859%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F555594%22%20target%3D%22_blank%22%3E%40Jeff_Nowak_Purdue_U_FW%3C%2FA%3E%26nbsp%3BHi%2C%20I%20liked%20your%20solution%20to%20this%20problem%20albeit%2C%20as%20you%20said%2C%20rather%20tedious%20to%20implement.%20The%20main%20problem%20would%20be%20remembering%20to%20insert%20the%20text%20file%20in%20every%20newly%20created%20folder.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20interested%20to%20know%20whether%20you%20found%20another%20solution%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%20George%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1311253%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1311253%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F34014%22%20target%3D%22_blank%22%3E%40Cindy%20Zalme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20bit%20of%20time%20has%20passed%20since%20this%20question%2C%20however%20in%20my%20experience%20the%20granular%20'delete'%20permission%20is%20related%20to%20the%20following%20actions%20someone%20might%20want%20to%20do%3A%3C%2FP%3E%3CUL%20class%3D%22lia-list-style-type-square%22%3E%3CLI%3EDelete%2C%3C%2FLI%3E%3CLI%3ERename%2C%20and%3C%2FLI%3E%3CLI%3EMove%3C%2FLI%3E%3C%2FUL%3E%3CP%3ENB%3A%20as%20aforementioned%20by%20others%20in%20this%20post%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20implemented%20a%20delete%20restriction%20in%20document%20library%20where%20I%20wanted%20more%20control%20I%20created%20a%20workflow%20to%20be%20manually%20run%20which%20allowed%20someone%20to%20provide%20the%20new%20name%20of%20the%20file.%20It%20then%20renamed%20the%20file%20using%20a%20specific%20account%20that%20had%20elevated%20rights%20to%20the%20library.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20was%20implemented%20on-premise%20and%20I%20am%20yet%20to%20re-create%20this%20online%2C%20however%20I%20imagine%20the%20logic%20would%20work%20the%20same.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1313205%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1313205%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F623554%22%20target%3D%22_blank%22%3E%40collabrius%3C%2FA%3E%26nbsp%3BThat%20sounds%20very%20helpful%20for%20my%20situation%2C%20provided%20its%20works%20online.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWould%20it%20be%20possible%20to%20use%20the%20same%2Fsimilar%20method%20for%20moving%20a%20file%20when%20delete%20permission%20is%20off.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1331010%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20deletion%20of%20SharePoint%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1331010%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F621021%22%20target%3D%22_blank%22%3E%40GS_Gordon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat's%20a%20very%20good%20question.%20Moving%20files%20is%20on%20my%20radar%20as%20a%20function%20I%20need%20to%20test%20for%20two%20reasons%3A%3C%2FP%3E%3CP%3E-%20I%20like%20maintaining%20a%20single%20version%20of%20the%20truth%2C%20and%3C%2FP%3E%3CP%3E-%20in%20some%20environments%20people%20keep%20everything%20regardless%20of%20being%20deleted%2C%20which%20adds%20to%20total%20capacity%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWill%20let%20you%20know%20how%20I%20get%20on.%20Once%20working%20I%20will%20test%20it%20with%20the%20custom%20permission%20level.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F623554%22%20target%3D%22_blank%22%3E%40collabrius%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

We had a situation where an end user accidentally deleted thousands for files under a SharePoint document library via OneDrive.

 

The document library itself is accessible to everyone within the company.

 

Is it possible to prevent users from deleting files within a document library and all subfolders?

 

All users currently have "Edit" permissions allowing users to add, update and delete all items. There doesn't appear to be a permission level that allows all this except for delete.

 

2019-07-05_12-23-13.png

16 Replies
Highlighted

Hi @telecaster,

 

I don't believe that is possible with out of the box permissions.

 

Is an additional document library with read only permissions reasonable?

 

I hope this helps.

 

Norm

 

Highlighted
Solution
You 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.
Highlighted

@Alan Marshall~ Thanks for pointing that out. I forgot that was possible.

 

@telecaster ~ Sorry if I led you astray.

 

 

Highlighted

@Alan MarshallThanks for your help, much appreciated.

 

The setting is under Site settings > Site permissions > Permission levels.

 

2019-07-08_13-06-15.png

Highlighted

@Alan Marshall 

 

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.

Highlighted
That should only require edit rights as it's a property. Maybe someone at Microsoft can confirm this.
Highlighted

@Alan Marshall 

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-f...

 

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.

Highlighted

@Alan Marshall 

 

I agree but users always need to delete the files, you just need to train them also you are able to recover all the files after deletion. 

Highlighted

@telecaster  I'm not seeing the Manage options on our SharePoint sites.  We are on a Government Tenant, so I'm wondering if that feature just isn't available yet or if it is something we can add to the menu.  

clipboard_image_0.png

Highlighted
You are right. I used Views to prevent users from deleting files from others. The ability to recover after deleting a file is also reassuring. Thanks.
Highlighted

@telecaster I am also facing this same issue in that I'd like to prevent users from deleting files.  However, it also seems to prevent their being able to move files. 

Could someone please confirm for me those two are also related.  Also, what else might be affected if you do not allow delete? 

Anyone know of a User Voice to vote for this option.  It seems to be a frequent request -- to prevent delete but allow other options. 

 

Thank you in advance for your help, everyone! 

Highlighted

@telecaster 

I am not an Admin of our SharePoint instance, but I do have the ability to create sub sites. I can’t create my own unique permissions either. I have to work within the defaults I’m provided. I also don’t want the Users deleting their folders on which they can Contribute as all the permissions on the folder go with the folder and it’s a headache to fix - maybe even detrimental depending on what files are lost and the retention policies in place. The “can’t be done” answer is less appealing to me than a slightly tedious solution that works.

 

One option to consider trying - that works for me - is to:

 

1.) Place a tiny txt file in the Member (User) [or Group folder] and then as Owner “Do not share” the txt file so it is only visible to the Owner. In other words, the Owner has Full Control on the txt file, and no one else has any access - therefore they don’t even see it in their folder on which they have Contribute permission. Then

 

2.) Right-click on the txt file as Owner and “Check out” the file.

 

It’s a bit of a hack, but if the Member with Contribute rights tries to delete the folder either intentionally or by accident (even when appearing empty) they will be told the folder has a file checked out for editing and they can not delete the folder. 

If you have sub folders within the folder you wish retained, then placing this _.txt or do_not_delete.txt file in the sub folder will prevent easy deletion of both the sub folder and (all enclosing) folder(s). The Member’s file actions (i.e., create, rename, delete, etc.) on their own files are otherwise unaffected as only the txt file’s access is impacted.

The obvious downside is this ”fix” takes clicks within each User “Contribute” folder, but depending on the number of Users and folders the Owner has within the site, it may be worth the time spent and help you rest easier knowing the folder‘s aren't easily deleted.

If you have Admin control over the site I imagine you should be able to come up with a better way (i.e., faster and less tedious way) to achieve the same outcome.

Highlighted

@Jeff_Nowak_Purdue_U_FW Hi, I liked your solution to this problem albeit, as you said, rather tedious to implement. The main problem would be remembering to insert the text file in every newly created folder.

 

I'm interested to know whether you found another solution?

 

Regards, George

Highlighted

@Cindy Zalme 

A bit of time has passed since this question, however in my experience the granular 'delete' permission is related to the following actions someone might want to do:

  • Delete,
  • Rename, and
  • Move

NB: as aforementioned by others in this post

 

When I implemented a delete restriction in document library where I wanted more control I created a workflow to be manually run which allowed someone to provide the new name of the file. It then renamed the file using a specific account that had elevated rights to the library.

 

That was implemented on-premise and I am yet to re-create this online, however I imagine the logic would work the same.

 

Hope this helps.

Highlighted

@collabrius That sounds very helpful for my situation, provided its works online.

 

Would it be possible to use the same/similar method for moving a file when delete permission is off.

Highlighted

@GS_Gordon 

That's a very good question. Moving files is on my radar as a function I need to test for two reasons:

- I like maintaining a single version of the truth, and

- in some environments people keep everything regardless of being deleted, which adds to total capacity

 

Will let you know how I get on. Once working I will test it with the custom permission level.

 

Cheers @collabrius