Documents permissions

fix #1018