Fix EZP-20949: Fatal error on versionview permission check

Additional fix as the 2 previous one (9984a39 and af78727) didn't cover
all cases.