Support contextual policies in permission updates.

This commit is contained in:
hackademix 2022-02-14 22:52:30 +01:00
parent 65f445bf82
commit 78609bb065
1 changed files with 9 additions and 0 deletions

View File

@ -265,6 +265,11 @@ var LifeCycle = (() => {
let changed = false;
for (let p of ns.policy.getPresets(presetNames)) {
if (callback(p)) changed = true;
if (p.contextual) {
for (let ctxP of p.contextual.values()) {
if (callback(ctxP)) changed = true;
}
}
}
if (changed) {
await ns.savePolicy();
@ -305,6 +310,10 @@ var LifeCycle = (() => {
if (Ver.is(previousVersion, "<=", "11.2.5rc1")) {
await renameCap("csspp0", "unchecked_css");
}
if (Ver.is(previousVersion, "<=", "11.3rc2")) {
// add the lan capability to any preset which already has the script capability
await configureNewCap("lan", ["DEFAULT", "TRUSTED", "CUSTOM"], caps => caps.has("script"));
}
},
async onUpdateAvailable(details) {