fixed hasAccess and added test

Fixes issue #154