backup restore preview works for view-only roles

This commit is contained in:
Jarek Krochmalski committed 2026-09-06 17:03:47 +05:30
1 parent a22ed6b809
commit 306d40c4d1
1 file changed
+3 -1
@@ -19,7 +19,9 @@ import { jobResult } from '$lib/server/sse';
*/
export const POST: RequestHandler = async ({ request, cookies }) => {
const auth = await authorize(cookies);
const rbacDenied = await requireBackups(auth, 'manage');
// Read-only: restic ls/dump + host probes, writes nothing (like snapshots dump/browse),
// so it gates on view. The actual restore (restore/+server.ts) still needs manage.
const rbacDenied = await requireBackups(auth, 'view');
if (rbacDenied) return rbacDenied;
const body = await request.json();