Is there a way to hide the structure panel form certain user groups?

I know AT has this option, but it’s a little bit overkill. Does anyone have a script for hiding the structure panel for an “editor”?

Kind regards, René