Fix #10 hasAccessToDocument is used for documents
Merge branch 'buttons_didnt_work'

Fix #13 and #10