Correctly check the permission to edit multiple files (see #7157)