Commit 9635027e authored by Kirk Steuber's avatar Kirk Steuber
Browse files

Bug 1436851 - Create an enterprise policy to disable system addon updates r=Felipe

MozReview-Commit-ID: AzxFGpFvxtm

--HG--
extra : rebase_source : c2f1ca7fe2e4328b2081784d38605b566e6f8c57
parent d076d477
......@@ -369,12 +369,18 @@ class JSONPoliciesProvider {
}
_getConfigurationFile() {
let configFile = Services.dirsvc.get("XREAppDist", Ci.nsIFile);
configFile.append(POLICIES_FILENAME);
let configFile = null;
try {
configFile = Services.dirsvc.get("XREAppDist", Ci.nsIFile);
configFile.append(POLICIES_FILENAME);
} catch (ex) {
// Getting the correct directory will fail in xpcshell tests. This should
// be handled the same way as if the configFile simply does not exist.
}
let alternatePath = Services.prefs.getStringPref(PREF_ALTERNATE_PATH, "");
if (alternatePath && !configFile.exists()) {
if (alternatePath && (!configFile || !configFile.exists())) {
// We only want to use the alternate file path if the file on the install
// folder doesn't exist. Otherwise it'd be possible for a user to override
// the admin-provided policies by changing the user-controlled prefs.
......
......@@ -190,6 +190,14 @@ var Policies = {
}
},
"DisableSysAddonUpdate": {
onBeforeAddons(manager, param) {
if (param) {
manager.disallowFeature("SysAddonUpdate");
}
}
},
"DisplayBookmarksToolbar": {
onBeforeUIStartup(manager, param) {
if (param) {
......
......@@ -158,6 +158,15 @@
"enum": [true]
},
"DisableSysAddonUpdate": {
"description": "Prevent the browser from installing and updating system addons.",
"first_available": "60.0",
"enterprise_only": true,
"type": "boolean",
"enum": [true]
},
"DisplayBookmarksToolbar": {
"description": "Causes the bookmarks toolbar to be displayed by default.",
"first_available": "60.0",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment