I usually use the hierarchical viewer for displaying all the data and manage its visibility via CSS and JS based on user actions. If you want to do this at server side, you can probably use WHERE condition like this: (NodeLevel <> 3 AND NodeLevel<>4) OR (NodeParentID = {% CurrentDocument.DocumentID |(identity)GlobalAdministrator%}))
The condition hides the items on 3rd and 4th level unless their parent or grand-parent is currently displayed document.