(reason = '')
| 108 | } |
| 109 | |
| 110 | function autoResolveAllPendingApprovals(reason = '') { |
| 111 | if (state.pendingApprovals.size === 0) return; |
| 112 | for (const [id, approval] of state.pendingApprovals) { |
| 113 | clearTimeout(approval.timer); |
| 114 | approval.res.writeHead(200, { 'Content-Type': 'application/json' }); |
| 115 | approval.res.end(JSON.stringify({ decision: 'allow' })); |
| 116 | log(`Permission #${id}: auto-allowed (${reason || 'effective mode switched to all'})`); |
| 117 | } |
| 118 | state.pendingApprovals.clear(); |
| 119 | broadcast({ type: 'clear_permissions' }); |
| 120 | } |
| 121 | |
| 122 | function recomputeEffectiveApprovalMode(reason = '') { |
| 123 | const connectedHighest = computeConnectedHighestApprovalMode(); |
no test coverage detected