Fixes has_access_to_entity() and get_access_array()

This also fixes #7155 as it relies on has_access_to_entity() while logged out and with ignore access on!
Changing something like this seems risky, but it doesn't seem to break any of the core uses for the function.