Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/toolkit/components/enterprisepolicies/EnterprisePolicies.js b/toolkit/components/enterprisepolicies/EnterprisePolicies.js
- index b4742ee123..87556bd43a 100644
- --- a/toolkit/components/enterprisepolicies/EnterprisePolicies.js
- +++ b/toolkit/components/enterprisepolicies/EnterprisePolicies.js
- @@ -26,6 +26,11 @@ const POLICIES_FILENAME = "policies.json";
- // When true browser policy is loaded per-user from
- // /run/user/$UID/appname
- const PREF_PER_USER_DIR = "toolkit.policies.perUserDir";
- +// used to specify where to load the policies from.
- +// value of `1` means to use the dir `/run/user/$UID/appname`, whereas
- +// a value of `2` will use the profile dir, to load the `policies.json`.
- +// `/etc/firefox/policies/policies.json` overrides everything else.
- +const PREF_POLICIES_LOADFROM_DIR = "toolkit.policies.loadFrom";
- // For easy testing, modify the helpers/sample.json file,
- // and set PREF_ALTERNATE_PATH in firefox.js as:
- // /your/repo/browser/components/enterprisepolicies/helpers/sample.json
- @@ -490,8 +495,11 @@ class JSONPoliciesProvider {
- try {
- let perUserPath = Services.prefs.getBoolPref(PREF_PER_USER_DIR, false);
- - if (perUserPath) {
- + let loadFromDir = Services.prefs.getIntPref(PREF_POLICIES_LOADFROM_DIR, 0);
- + if (perUserPath || loadFromDir == 1) {
- configFile = Services.dirsvc.get("XREUserRunTimeDir", Ci.nsIFile);
- + } else if (loadFromDir == 2) {
- + configFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
- } else {
- configFile = Services.dirsvc.get("XREAppDist", Ci.nsIFile);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement