XWIKI-9826: Fix a regression in hasAccessLevel() check

(cherry-picked from commit 246ed80543debdd2d7ba0ea6b686931da1b91e60)