Fix deleting non deletable files by selecting them

- Check permissions before trying to delete a file, prevents hooks being triggered/cache being updated for failed deletes
- Check if all selected files are deletable before showing the delete button for selected files

Fixes #12161

cc @PVince81 @DeepDiver1975