Issue #9792 done. Added building user trees depending on departments structure