diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index d7e7841..db88ff6 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -39,14 +39,11 @@ import PlatformAdminRoute from './components/PlatformAdminRoute' import MediaLibraryPage from './pages/MediaLibraryPage' import ActiveClubSwitcher from './components/ActiveClubSwitcher' import InactiveMembershipBanner from './components/InactiveMembershipBanner' -import { activeClubMemberships } from './utils/activeClub' import './app.css' -/** Shield-„Admin“: Portal-Admins oder Vereinsorganisation (Zugriff mindestens /admin/users). */ +/** Shield „Admin“: nur Super-Admin (global). Vereinsorga: Vereine → Mitglieder. */ function computeShowAdminNav(currentUser) { - const plat = currentUser?.role === 'admin' || currentUser?.role === 'superadmin' - if (plat) return true - return activeClubMemberships(currentUser?.clubs).some((c) => (c.roles || []).includes('club_admin')) + return currentUser?.role === 'superadmin' } // Bottom Navigation (Mobile) @@ -196,7 +193,14 @@ function AppRoutes() { } /> } /> } /> - } /> + + + + } + /> + const isSuper = user?.role === 'superadmin' + return } diff --git a/frontend/src/components/AdminPageNav.jsx b/frontend/src/components/AdminPageNav.jsx index 6970eef..11a9955 100644 --- a/frontend/src/components/AdminPageNav.jsx +++ b/frontend/src/components/AdminPageNav.jsx @@ -2,19 +2,16 @@ import { NavLink } from 'react-router-dom' import { TreePine, FolderTree, Download, Grid3x3, Users } from 'lucide-react' /** - * Admin-Seiten-Navigation (horizontal) - * Nutzer-Verwaltung: eingeschränkte Tabs für Vereinsorga ohne Plattform-Admin. + * Admin-Seiten-Navigation (horizontal) — nur für Super-Admins (globaler Portal-Mandant). */ -export default function AdminPageNav({ clubOrgOnly = false }) { - const pages = clubOrgOnly - ? [{ to: '/admin/users', label: 'Nutzer', icon: Users }] - : [ - { to: '/admin/hierarchy', label: 'Hierarchie', icon: TreePine }, - { to: '/admin/users', label: 'Nutzer', icon: Users }, - { to: '/admin/maturity-models', label: 'Fähigkeitsmatrix', icon: Grid3x3 }, - { to: '/admin/catalogs', label: 'Kataloge', icon: FolderTree }, - { to: '/admin/mediawiki-import', label: 'Wiki-Import', icon: Download }, - ] +export default function AdminPageNav() { + const pages = [ + { to: '/admin/hierarchy', label: 'Hierarchie', icon: TreePine }, + { to: '/admin/users', label: 'Nutzer', icon: Users }, + { to: '/admin/maturity-models', label: 'Fähigkeitsmatrix', icon: Grid3x3 }, + { to: '/admin/catalogs', label: 'Kataloge', icon: FolderTree }, + { to: '/admin/mediawiki-import', label: 'Wiki-Import', icon: Download }, + ] return (