[MERGE]merged with 7.0
[FIX]Added record rules for documents of a directory as per the permissions defined in document access_permission.rst
[ADD] document: record rules to match the one defined in access_permissions.rst
[FIX] same without record rules, python side
[FIX] better check
[FIX] document: apply security rules documented on doc/access_permissions.rst. (opw #592652)