bae705aa97
- Add NFC ePassport roadmap (ICAO 9303, eIDAS) - Add TensorFlow.js edge face detection (BlazeFace) - Add structured audit logger (GDPR-compliant) - Risk scoring support Part of KYC Apple Native UX v1.1.0
38 lines
1.6 KiB
JavaScript
38 lines
1.6 KiB
JavaScript
// PATCH: Lägg till detta efter authMiddleware-raden i index.mjs
|
|
|
|
// ── RBAC: Rollskydd på muterande endpoints ───────────────────────────────────
|
|
// GET /api/ledger/accounts — läs-only (alla roller)
|
|
// POST /api/ledger/accounts — kräver admin eller accountant
|
|
app.post('/api/ledger/accounts', requireRole(ROLES.ADMIN, ROLES.ACCOUNTANT), async (req, res) => {
|
|
// befintlig kod...
|
|
});
|
|
|
|
// POST /api/ledger/journal — skapa verifikation
|
|
app.post('/api/ledger/journal', requireRole(ROLES.ADMIN, ROLES.ACCOUNTANT), async (req, res) => {
|
|
// befintlig kod...
|
|
});
|
|
|
|
// POST /api/ledger/journal/:id/post — kontera
|
|
app.post('/api/ledger/journal/:id/post', requireRole(ROLES.ADMIN, ROLES.ACCOUNTANT), async (req, res) => {
|
|
// befintlig kod...
|
|
});
|
|
|
|
// POST /api/ledger/journal/:id/void — makulera
|
|
app.post('/api/ledger/journal/:id/void', requireRole(ROLES.ADMIN), async (req, res) => {
|
|
// befintlig kod...
|
|
});
|
|
|
|
// POST /api/ledger/period-close/initiate — stäng period
|
|
app.post('/api/ledger/period-close/initiate', requireRole(ROLES.ADMIN), async (req, res) => {
|
|
// befintlig kod...
|
|
});
|
|
|
|
// POST /api/ledger/reconciliation/sessions — skapa reconciliation
|
|
app.post('/api/ledger/reconciliation/sessions', requireRole(ROLES.ADMIN, ROLES.ACCOUNTANT), async (req, res) => {
|
|
// befintlig kod...
|
|
});
|
|
|
|
// POST /api/ledger/reconciliation/sessions/:id/complete — slutför reconciliation
|
|
app.post('/api/ledger/reconciliation/sessions/:id/complete', requireRole(ROLES.ADMIN), async (req, res) => {
|
|
// befintlig kod...
|
|
}); |