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
+9 -1
View File
@@ -344,6 +344,14 @@ test('integration: apply-publish route binds dataset after publication', async (
assert.equal(applied.status, 200);
assert.equal(applied.body.data.policy.datasets.signups.read, true);
const publicReadEmpty = await request(app, 'GET', `/api/public/pages/${PAGE_ID}/data/signups`);
assert.equal(publicReadEmpty.status, 200);
assert.equal(publicReadEmpty.body.data.rows.length, 0);
await request(app, 'POST', `/api/public/pages/${PAGE_ID}/data/signups/rows`, {
body: { name: '发布后公开读', phone: '13800000000' },
});
const publicRead = await request(app, 'GET', `/api/public/pages/${PAGE_ID}/data/signups`);
assert.equal(publicRead.status, 403);
assert.equal(publicRead.status, 200);
assert.equal(publicRead.body.data.rows.length, 1);
});