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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user