Anmeldung und Rollen: eigene Zugänge, Benutzerverwaltung, Mitarbeiter-Ansicht (0.7.0)
Stufe 2, Schritt 1 (U1, U2, E27, P13). Passwörter mit scrypt, Sitzung als HttpOnly-Cookie (90 Tage, gleitend), in der Datenbank nur der SHA-256. Rollen Inhaber, Büro, Mitarbeiter; Mitarbeiter sehen nur eigene Einsätze und die Ablage ihrer Projekte. Testversion ohne Passwörter mit Auswahl, als wer gearbeitet wird. Anmeldung am Proxy entfällt. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
@@ -62,7 +62,7 @@ async function main() {
|
||||
if (speicher) {
|
||||
melde("Deine Daten werden geladen …");
|
||||
const daten: Record<string, Record<string, unknown>[]> = {};
|
||||
for (const t of TABELLEN) daten[t.pfad] = await nochmal(() => alle(speicher, t.pfad));
|
||||
for (const pfad of [...TABELLEN.map((t) => t.pfad), "benutzer"]) daten[pfad] = await nochmal(() => alle(speicher, pfad));
|
||||
const e = await nochmal(() => speicher.doc("meta/einstellungen").get());
|
||||
if (Object.values(daten).some((z) => z.length) || e.exists) {
|
||||
const r = await app.verarbeite("POST", "/api/import/stand", { programm: "betrieb", einstellungen: e.data()?.daten, daten });
|
||||
@@ -104,7 +104,8 @@ async function main() {
|
||||
if (!adresse.startsWith("/api/")) return original(eingabe, init);
|
||||
const methode = (init?.method ?? "GET").toUpperCase();
|
||||
const body = typeof init?.body === "string" ? JSON.parse(init.body) : undefined;
|
||||
const antwort = await app.verarbeite(methode, adresse, body, { "x-benutzer": "henning" });
|
||||
// die Oberfläche schickt mit, als wer Henning gerade arbeitet (x-test-benutzer)
|
||||
const antwort = await app.verarbeite(methode, adresse, body, Object.fromEntries(new Headers(init?.headers).entries()));
|
||||
if (methode !== "GET" && antwort.ok) await speichern();
|
||||
return antwort;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user