'use client' /** * RBAC Management Page * * Features: * - Multi-tenant management * - Namespace-based isolation (CFO use case) * - Role management with permissions * - User-Role assignments with scope * - LLM access policies */ import { PagePurpose } from '@/components/common/PagePurpose' import { useRbacData } from './useRbacData' import { TABS } from './types' import type { Tenant, Namespace, Role, LLMPolicy } from './types' import { TenantsTable } from './_components/TenantsTable' import { NamespacesTable } from './_components/NamespacesTable' import { RolesTable } from './_components/RolesTable' import { UserRolesTable } from './_components/UserRolesTable' import { PoliciesTable } from './_components/PoliciesTable' import { CreateModal } from './_components/CreateModal' export default function RBACPage() { const { activeTab, setActiveTab, loading, error, tenants, userRoles, selectedTenantId, setSelectedTenantId, searchTerm, setSearchTerm, showCreateModal, setShowCreateModal, setEditItem, handleCreate, filteredData, stats, } = useRbacData() return (
{/* Header */}

RBAC Management

Rollen, Berechtigungen & LLM-Zugriffskontrolle

{/* Statistics */}
{[ { label: 'Mandanten', value: stats.tenants, border: 'border-slate-200', text: 'text-slate-500', bold: 'text-slate-900' }, { label: 'Namespaces', value: stats.namespaces, border: 'border-blue-200', text: 'text-blue-600', bold: 'text-blue-700' }, { label: 'Rollen', value: stats.roles, border: 'border-purple-200', text: 'text-purple-600', bold: 'text-purple-700' }, { label: 'System-Rollen', value: stats.systemRoles, border: 'border-indigo-200', text: 'text-indigo-600', bold: 'text-indigo-700' }, { label: 'LLM-Policies', value: stats.policies, border: 'border-teal-200', text: 'text-teal-600', bold: 'text-teal-700' }, { label: 'Zuweisungen', value: stats.activeUsers, border: 'border-green-200', text: 'text-green-600', bold: 'text-green-700' }, ].map(s => (

{s.label}

{s.value}

))}
{/* Tabs + Content */}
{/* Search and Actions */}
setSearchTerm(e.target.value)} className="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-primary-500" />
{/* Content */}
{error && (
{error}
)} {loading ? (
) : ( <> {activeTab === 'tenants' && } {activeTab === 'namespaces' && } {activeTab === 'roles' && } {activeTab === 'users' && } {activeTab === 'policies' && } )}
{/* Create Modal */} {showCreateModal && ( setShowCreateModal(false)} onSave={handleCreate} /> )}
) }