- Agent: Web-Suche als Dropdown (Deaktiviert / 2025 / 2026) statt bool - AnthropicService: web_search Tool dynamisch nach Version einfügen - Stream: server_tool_use + web_search_tool_result Events verarbeiten - Chat-Frontend: web_search_start/end Events mit Suchindikator - Dashboard: Badge zeigt Web-Suche mit Jahresversion - UserRecord: IsAdmin Feld, DB-Migration is_admin Spalte - AuthMiddleware: IsAdmin aus DB laden und in Context setzen - BackupEndpoint: Admin-Check (403 für Nicht-Admins) - AuthEndpoint: isAdmin in Login/Me Response - Frontend: Backup-Section nur für Admins sichtbar - Haiku 4.5 als Model-Option (Agent-Dropdown + ChatEndpoint) - TODO: Cronjobs, Haiku ergänzt
17 lines
334 B
C#
17 lines
334 B
C#
using Microsoft.AspNetCore.Http;
|
|
|
|
namespace Gott.Extensions;
|
|
|
|
public static class HttpContextExtensions
|
|
{
|
|
public static string GetUserId(this HttpContext ctx)
|
|
{
|
|
return ctx.Items["UserId"] as string;
|
|
}
|
|
|
|
public static bool IsAdmin(this HttpContext ctx)
|
|
{
|
|
return ctx.Items["IsAdmin"] is true;
|
|
}
|
|
}
|