Fixes #80823 and improvements to canAcess method