- Neue Felder CanCreateAgents und CanUseCli im UserRecord (Default: true) - DB-Migration mit Abwärtskompatibilität (bestehende User behalten alle Rechte) - Admin-UI: Checkboxen für beide Berechtigungen pro User - AgentEndpoint: Prüfung auf CanCreateAgents beim Erstellen - ChatEndpoint: CLI-Fallback nur wenn CanUseCli erlaubt - Frontend: Neuer-Agent-Button und Agent-Page bei fehlender Berechtigung gesperrt - Chat: Proaktive Warnung wenn kein API-Key und keine CLI-Berechtigung - Bug Fix: is_public fehlte im Agent-INSERT (Public Agents erst nach erneutem Speichern sichtbar) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
896 B
C#
29 lines
896 B
C#
namespace Gott.Models;
|
|
|
|
public class UserRecord
|
|
{
|
|
public int Id { get; set; }
|
|
public string UserId { get; set; }
|
|
public string Username { get; set; }
|
|
public string PasswordHash { get; set; }
|
|
public string DisplayName { get; set; }
|
|
public string CreatedAt { get; set; }
|
|
public string UpdatedAt { get; set; }
|
|
public bool IsAdmin { get; set; }
|
|
public string Persona { get; set; }
|
|
public string Settings { get; set; }
|
|
public string DefaultPath { get; set; }
|
|
public string SelectedApiKeyId { get; set; }
|
|
public bool CanCreateAgents { get; set; }
|
|
public bool CanUseCli { get; set; }
|
|
|
|
public string GetEffectivePersona()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(Persona))
|
|
return Persona;
|
|
|
|
var name = !string.IsNullOrWhiteSpace(DisplayName) ? DisplayName : Username;
|
|
return $"Mein Name ist **{name}**.";
|
|
}
|
|
}
|