示例


【Example】

{
  "scopes": {
    "file:///C:/app/": {},
    "file:": {},
    "": {}
  }
} 

给定一个位于 file:///C:/app/bin/main.js 的文件,将按以下顺序检查作用域:

【Given a file located at file:///C:/app/bin/main.js, the following scopes would be checked in order:】

  1. "file:///C:/app/bin/"

这决定了所有基于文件的资源的策略 “file:///C:/app/bin/”。这不属于保单的“范围”范畴,且 会跳过。将此范围加入政策会导致其被使用。 在“file:///C:/app/”范围之前。

【This determines the policy for all file based resources within "file:///C:/app/bin/". This is not in the "scopes" field of the policy and would be skipped. Adding this scope to the policy would cause it to be used prior to the "file:///C:/app/" scope.】

  1. "file:///C:/app/"

这决定了所有基于文件的资源的策略 “file:///C:/app/”。这属于保单的“范围”部分,应该是 确定资源在“file:///C:/app/bin/main.js”的策略。如果 范围的“级联”:true,任何未满足的资源查询 将“file:///C:/app/bin/main.js”授权给下一个相关范围,即“文件:”。

【This determines the policy for all file based resources within "file:///C:/app/". This is in the "scopes" field of the policy and it would determine the policy for the resource at file:///C:/app/bin/main.js. If the scope has "cascade": true, any unsatisfied queries about the resource would delegate to the next relevant scope for file:///C:/app/bin/main.js, "file:".】

  1. "file:///C:/"

这确定了所有位于 "file:///C:/" 的基于文件的资源的策略。这不在策略的 "scopes" 字段中,因此会被忽略。除非将 "file:///" 设置为级联,或者它不在策略的 "scopes" 中,否则它不会用于 file:///C:/app/bin/main.js

【This determines the policy for all file based resources within "file:///C:/". This is not in the "scopes" field of the policy and would be skipped. It would not be used for file:///C:/app/bin/main.js unless "file:///" is set to cascade or is not in the "scopes" of the policy.】

  1. "file:///"

这决定了 localhost 上所有基于文件的资源的策略。这不在策略的 "scopes" 字段中,因此会被跳过。除非将 "file:///" 设置为级联或它不在策略的 "scopes" 中,否则不会用于 file:///C:/app/bin/main.js

【This determines the policy for all file based resources on the localhost. This is not in the "scopes" field of the policy and would be skipped. It would not be used for file:///C:/app/bin/main.js unless "file:///" is set to cascade or is not in the "scopes" of the policy.】

  1. "file:"

这决定了所有基于文件的资源的策略。除非将 "file:///" 设置为级联或未包含在策略的 "scopes" 中,否则不会用于 file:///C:/app/bin/main.js

【This determines the policy for all file based resources. It would not be used for file:///C:/app/bin/main.js unless "file:///" is set to cascade or is not in the "scopes" of the policy.】

  1. ""

这决定了所有资源的策略。除非设置了 "file:" 来级联,否则不会用于 file:///C:/app/bin/main.js

【This determines the policy for all resources. It would not be used for file:///C:/app/bin/main.js unless "file:" is set to cascade.】