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!

TODO:
 - [ ] Add test cases