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