Block overwrite in Site Assets Library?
-
29-09-2020 - |
Question
I'm working on a SP2010 list where any authenticated user may submit list entries. Each list entry has a rich text column allowing uploaded images, etc. Those uploaded images get deposited into the Site Assets library. Problem is, nothing keeps user A from overwriting user B's images if they happen to have the same name.
I see no way to prevent users from overwriting one another's items in the Site Assets library. Nor do I see a means of unchecking that default "Overwrite existing" checkbox that is displayed when adding an item to the Site Assets library.
I even went as far as creating (per suggestion found elsewhere here on SPSE) a custom permission level that has Add but not Edit or Delete for list permissions. That didn't work.
Is there a practical way to prevent users from overwriting one another's items in a Site Assets library?
Solution
Use a Custom Action with Location="ScriptLink"
and inject jQuery/JS on the fly, which hides or uncheck the button by default