- UserId-Feld zu SessionRecord und AgentRecord hinzugefügt - DB-Migration: user_id Spalte + bestehende Daten dem Admin zuweisen - Alle Endpoints filtern/prüfen nach UserId des eingeloggten Users - HttpContextExtensions.GetUserId() Helper für konsistenten Zugriff - Betrifft: Agent, Session, Chat, History, Workspace, Skill Endpoints - Sessions/Agents anderer User sind nicht sichtbar/zugreifbar
12 lines
223 B
C#
12 lines
223 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;
|
|
}
|
|
}
|