Get backend user in frontend layout

Hi, I’m try to show various content to a backend user vs visitor.

In my layout, I’ve added this already to get the backend user data.

function onStart() {
    $this['user'] = BackendAuth::getUser();	

To do something in the layout itself, I did this already.

{% if user.is_superuser == 1 %} 
{% else %}
{% endif %}

This is not working for me in OC3.
Anyone an idea/suggestion?

The code you provide works for me.

You can do this

function onStart() {

and see the instance Backend\Models\User displayed (looking into the attributes, you will be able to confirm is_superuser == 1).