Recursively hide tree sub categories at deeper levels and update permiss...

...ions for documents and categories