diff --git a/src/Cms/Language.php b/src/Cms/Language.php index 2bf67ac009..6de9f3a8ba 100644 --- a/src/Cms/Language.php +++ b/src/Cms/Language.php @@ -307,7 +307,7 @@ public function exists(): bool public function isAccessible(): bool { static $accessible = []; - $role = $this->kirby()->user()?->role()->id() ?? 'nobody'; + $role = $this->kirby()->role()?->id() ?? '__none__'; return $accessible[$role] ??= $this->permissions()->can('access'); } diff --git a/src/Cms/User.php b/src/Cms/User.php index 673c45b385..a484d02ced 100644 --- a/src/Cms/User.php +++ b/src/Cms/User.php @@ -287,7 +287,7 @@ public function is(User|null $user = null): bool public function isAccessible(): bool { static $accessible = []; - $role = $this->role()->id(); + $role = $this->kirby()->role()?->id() ?? '__none__'; return $accessible[$role] ??= $this->permissions()->can('access'); }