refac: DELETE /v1/user/{id}?expected_role_id=N, user.remove audit event, 409 target_role_not_found, GetAll returns its error, Own-scope visibility filter moved into repos, JSON tags removed from use-case types

This commit is contained in:
Florian Sylvain committed 2026-10-29 16:28:25 +01:00
1 parent 5d6f378fce
commit b39a41be88
124 files changed
+8816 -523

No files matched your search

+39
View File
@@ -251,6 +251,45 @@ describe('custom content types', () => {
})
})
describe('roles sync: permission-gated routes', () => {
const GATED = [
'POST /v1/content-type/',
'PUT /v1/content-type/{key}',
'DELETE /v1/content-type/{key}',
'GET /v1/builtin-type/',
'GET /v1/builtin-type/{key}',
'GET /v1/media/purge-settings',
'PATCH /v1/media/purge-settings',
'GET /v1/media/purge-preview',
'POST /v1/media/purge',
]
it('matches "permission" on the nine routes through the access chip and the description', () => {
const found = routes(search('permission').endpoints)
for (const route of GATED) {
expect(found).toContain(route)
}
})
it('matches "missing_permission" on the error code of the gated routes', () => {
const found = search('missing_permission').endpoints
for (const route of GATED) {
expect(routes(found)).toContain(route)
}
expect(found.find((hit) => routes([hit])[0] === GATED[0])!.via!.kind).toBe('error')
})
it('no longer matches "owner or admin" on the nine routes', () => {
const found = routes(search('owner or admin').endpoints)
for (const route of GATED) {
expect(found).not.toContain(route)
}
})
})
describe('suggestions', () => {
it('lists the five suggested rows in order', () => {
expect(routes(suggestedHits(index))).toEqual([