--permission-audit
为权限模型启用审核模式。启用后,会进行权限检查,但访问不会被拒绝——不会抛出 ERR_ACCESS_DENIED 错误。相反,每次权限违规都会通过 node:diagnostics_channel 模块发布,并且执行会照常继续。
🌐 Enable audit mode for the permission model. When enabled, permission checks
are performed but access is not denied — no ERR_ACCESS_DENIED error is
thrown. Instead, each permission violation is published through the
node:diagnostics_channel module, and execution continues normally.
这个标志不需要指定--permission。在审计模式下不需要--allow-*标志,因为没有访问被拒绝。
🌐 This flag does not require --permission to be specified. The
--allow-* flags are not needed in audit mode, since no
access is denied.
审计模式对于在使用 --permission 部署之前发现你的应用需要哪些权限很有用。请参阅 权限模型 文档以获取诊断通道名称列表和消息格式。
🌐 Audit mode is useful for discovering what permissions your application
requires before deploying with --permission. See the
Permission Model documentation for the list of diagnostics channel names
and the message format.
如果同时指定了 --permission 和 --permission-audit,--permission 会优先,权限模型会以强制模式运行。
🌐 If both --permission and --permission-audit are specified,
--permission takes precedence and the Permission Model runs in enforce mode.