feat: Login-as-User (Impersonate) + Default-Path pro User

Admin:
- POST /api/admin/users/{userId}/impersonate – erstellt Token für Zieluser
- Login-as-Button (fa-sign-in) in User-Liste (nicht für sich selbst)
- confirm-Dialog, danach location.reload() mit neuem User-Kontext
- Default-Path Feld + Browse-Button im Admin-Formular

Default-Path:
- Neues Feld default_path in users-Tabelle (TryAddColumn Migration)
- UserRecord.DefaultPath Property
- In allen Endpoints: Admin CRUD, Auth /me, Profile Get/Update
- Profil-Seite: Default-Path Feld + Browse-Button
- Session-Seite: Workspace-Browse nutzt defaultPath als Fallback
This commit is contained in:
Meleki committed 2026-03-05 20:42:21 +01:00
1 parent df68843e82
commit d1355dcb0d
10 files changed
+144 -17

No files matched your search

+4 -1
View File
@@ -33,6 +33,7 @@ public static class ProfileEndpoint
username = user.Username,
displayName = user.DisplayName,
persona = user.Persona,
defaultPath = user.DefaultPath,
isAdmin = user.IsAdmin
});
}
@@ -44,8 +45,9 @@ public static class ProfileEndpoint
var displayName = body.TryGetProperty("displayName", out var dn) ? dn.GetString() : null;
var persona = body.TryGetProperty("persona", out var p) ? p.GetString() : null;
var defaultPath = body.TryGetProperty("defaultPath", out var dp) ? dp.GetString() : null;
await db.UpdateUserProfile(userId, displayName, persona);
await db.UpdateUserProfile(userId, displayName, persona, defaultPath);
var user = await db.GetUser(userId);
await ctx.Response.WriteAsJsonAsync(new
@@ -54,6 +56,7 @@ public static class ProfileEndpoint
username = user.Username,
displayName = user.DisplayName,
persona = user.Persona,
defaultPath = user.DefaultPath,
isAdmin = user.IsAdmin
});
}