887 fix mongoid accessible by

Fix to implement the behavior describe in this issue. Mostly copies the logic from the activerecord adapter which does this properly.