in case anyone is interested in… that’s my solution in config.php
now:
'ready' => function ($kirby) {
$loggedinadmin = false;
if (kirby()->user()) {
if (kirby()->user()->role()->id() === "admin") {
$loggedinadmin = true;
}
}
return ['debug' => $loggedinadmin];
}