Bug 1446477 - Add policy for security.enterprise_roots.enabled. r?felipe
MozReview-Commit-ID: 9c3lcCRVKDx
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -115,16 +115,24 @@ var Policies = {
},
"Bookmarks": {
onAllWindowsRestored(manager, param) {
BookmarksPolicies.processBookmarks(param);
}
},
+ "Certificates": {
+ onBeforeAddons(manager, param) {
+ if ("ImportEnterpriseRoots" in param) {
+ setAndLockPref("security.enterprise_roots.enabled", true);
+ }
+ }
+ },
+
"Cookies": {
onBeforeUIStartup(manager, param) {
addAllowDenyPermissions("cookie", param.Allow, param.Block);
if (param.Block) {
const hosts = param.Block.map(uri => uri.host).sort().join("\n");
runOncePerModification("clearCookiesForBlockedHosts", hosts, () => {
for (let blocked of param.Block) {
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -93,16 +93,28 @@
"Folder": {
"type": "string"
}
},
"required": ["Title", "URL"]
}
},
+ "Certificates": {
+ "description": "Whether or not to use built in certs.",
+ "first_available": "60.0",
+
+ "type": "object",
+ "properties": {
+ "ImportEnterpriseRoots": {
+ "type": "boolean"
+ }
+ }
+ },
+
"Cookies": {
"description": "Allow or deny websites to set cookies.",
"first_available": "60.0",
"type": "object",
"properties": {
"Allow": {
"type": "array",
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
@@ -78,16 +78,26 @@ const POLICIES_TESTS = [
}
},
lockedPrefs: {
"network.negotiate-auth.trusted-uris": "a.com, b.com",
"network.negotiate-auth.delegation-uris": "a.com, b.com",
"network.automatic-ntlm-auth.trusted-uris": "a.com, b.com",
}
},
+ {
+ policies: {
+ "Certificates": {
+ "ImportEnterpriseRoots": true,
+ }
+ },
+ lockedPrefs: {
+ "security.enterprise_roots.enabled": true,
+ }
+ },
];
add_task(async function test_policy_remember_passwords() {
for (let test of POLICIES_TESTS) {
await setupPolicyEngineWithJson({
"policies": test.policies
});