diff options
Diffstat (limited to 'src/common/Policy.js')
-rw-r--r-- | src/common/Policy.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/Policy.js b/src/common/Policy.js index d67c24f..674263a 100644 --- a/src/common/Policy.js +++ b/src/common/Policy.js @@ -451,6 +451,16 @@ var {Permissions, Policy, Sites} = (() => { return JSON.stringify(this.dry(true)); } + cascadeRestrictions(perms, topUrl) { + let topPerms = ns.policy.get(topUrl, topUrl).perms; + if (topPerms !== perms) { + let topCaps = topPerms.capabilities; + perms = new Permissions([...perms.capabilities].filter(c => topCaps.has(c)), + perms.temp, perms.contextual); + } + return perms; + } + equals(other) { this.snapshot === other.snapshot; } |