diff --git a/src/components/Header.astro b/src/components/Header.astro index 1729495..a959153 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,6 +1,7 @@ --- import { site } from '../data/site'; import { t, contentImageUrl } from '../lib/content'; +import { landingFor } from '../lib/auth'; interface Props { user: { username: string; role: string } | null; showTags: boolean; @@ -9,7 +10,9 @@ interface Props { const { user, canTags, showTags } = Astro.props; const path = Astro.url.pathname; const loginHref = `/login?next=${encodeURIComponent(path)}`; -const areaHref = user?.role === 'superuser' ? '/admin/content' : '/admin'; +const areaHref = user ? landingFor(user.role) : '/admin'; +// La sezione Biohacking compare nel menu solo a chi può davvero aprirla. +const canBiohacking = user?.role === 'campus' || user?.role === 'admin'; ---