[MODULES-173] More comprehensive checking of file access