feat(page-data): owner CRUD, public read, and role policy UI

Expose owner PATCH/soft-delete routes, allow anonymous read/stats on
public pages when policy enables read, and add login_required role
editor to the ops panel with tests and doc updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-08 14:54:14 +08:00
parent 6b0c633a75
commit 8d629e7a4e
11 changed files with 360 additions and 9 deletions
+20
View File
@@ -97,6 +97,24 @@ export function createPageDataService(deps = {}) {
}
}
async function updateRow(user, datasetName, rowId, payload) {
const { service } = await createServiceForUser(user);
try {
return service.updateDatasetRow(datasetName, rowId, payload);
} catch (error) {
throw mapServiceError(error);
}
}
async function softDeleteRow(user, datasetName, rowId) {
const { service } = await createServiceForUser(user);
try {
return service.softDeleteDatasetRow(datasetName, rowId, { deletedBy: user.id });
} catch (error) {
throw mapServiceError(error);
}
}
async function restoreRow(user, datasetName, rowId) {
const { service } = await createServiceForUser(user);
try {
@@ -164,6 +182,8 @@ export function createPageDataService(deps = {}) {
getSchema,
getStats,
insertRow,
updateRow,
softDeleteRow,
restoreRow,
exportDataset,
listDatasets,