The opt-in nginx dry-run test (NPM_TEST_NGINX=1) called
hostTest.buildHost() with an access stub that only had
token.getUserId. An edit runs the advanced config permission check,
which calls access.hasRole / access.token.hasScope, so the test threw a
TypeError before any of its dry-run checks ran.
The stub is now shaped like lib/access.js. The test also checks that the
permission path really runs: a user without admin rights can test an
edit, but not one that changes the advanced config.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>