Bug 1452104 - Final tweaks to policy names and params. r=Felipe

MozReview-Commit-ID: CxxCqnyavfL

--HG--
extra : rebase_source : 409d9c64f3017f91f729c302ec7e43f52fea8547
This commit is contained in:
Michael Kaply 2018-04-06 13:35:14 -05:00
Родитель be2f9c3933
Коммит 86af47e7de
7 изменённых файлов: 64 добавлений и 63 удалений

Просмотреть файл

@ -108,14 +108,6 @@ var Policies = {
}
},
"BlockSetDesktopBackground": {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("setDesktopBackground", true);
}
}
},
"Bookmarks": {
onAllWindowsRestored(manager, param) {
BookmarksPolicies.processBookmarks(param);
@ -155,7 +147,7 @@ var Policies = {
if (param.Default !== undefined && !param.Default) {
newCookieBehavior = REJECT_ALL_COOKIES;
} else if (param.AcceptThirdParty) {
if (param.AcceptThirdParty == "none") {
if (param.AcceptThirdParty == "never") {
newCookieBehavior = REJECT_THIRD_PARTY_COOKIES;
} else if (param.AcceptThirdParty == "from-visited") {
newCookieBehavior = REJECT_UNVISITED_THIRD_PARTY;
@ -187,14 +179,6 @@ var Policies = {
}
},
"CreateMasterPassword": {
onBeforeUIStartup(manager, param) {
if (!param) {
manager.disallowFeature("createMasterPassword");
}
}
},
"DisableAppUpdate": {
onBeforeAddons(manager, param) {
if (param) {
@ -273,6 +257,14 @@ var Policies = {
}
},
"DisableMasterPasswordCreation": {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("createMasterPassword");
}
}
},
"DisablePocket": {
onBeforeAddons(manager, param) {
if (param) {
@ -329,7 +321,15 @@ var Policies = {
}
},
"DisableSysAddonUpdate": {
"DisableSetDesktopBackground": {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("setDesktopBackground", true);
}
}
},
"DisableSystemAddonUpdate": {
onBeforeAddons(manager, param) {
if (param) {
manager.disallowFeature("SysAddonUpdate");
@ -342,6 +342,7 @@ var Policies = {
if (param) {
setAndLockPref("datareporting.healthreport.uploadEnabled", false);
setAndLockPref("datareporting.policy.dataSubmissionEnabled", false);
manager.disallowFeature("about:telemetry");
}
}
},
@ -525,7 +526,7 @@ var Policies = {
}
},
"InstallAddons": {
"InstallAddonsPermission": {
onBeforeUIStartup(manager, param) {
if ("Allow" in param) {
addAllowDenyPermissions("install", param.Allow, null);
@ -547,6 +548,12 @@ var Policies = {
}
},
"OfferToSaveLogins": {
onBeforeUIStartup(manager, param) {
setAndLockPref("signon.rememberSignons", param);
}
},
"OverrideFirstRunPage": {
onProfileAfterChange(manager, param) {
let url = param ? param.spec : "";
@ -592,12 +599,6 @@ var Policies = {
}
},
"RememberPasswords": {
onBeforeUIStartup(manager, param) {
setAndLockPref("signon.rememberSignons", param);
}
},
"SanitizeOnShutdown": {
onBeforeUIStartup(manager, param) {
setAndLockPref("privacy.sanitize.sanitizeOnShutdown", param);

Просмотреть файл

@ -58,13 +58,6 @@
"type": "boolean"
},
"BlockSetDesktopBackground": {
"description": "Prevents usage of the \"Set Image as Desktop Background\" feature.",
"first_available": "60.0",
"type": "boolean"
},
"Bookmarks": {
"description": "Allows the creation of bookmarks in the Bookmarks bar, Bookmarks menu, or a specified folder inside them.",
"first_available": "60.0",
@ -99,7 +92,7 @@
},
"Certificates": {
"description": "Whether or not to use built in certs.",
"description": "Whether or not to use built in certs. This policy is Windows only at this time.",
"first_available": "60.0",
"type": "object",
@ -136,7 +129,7 @@
"AcceptThirdParty": {
"type": "string",
"enum": ["all", "none", "from-visited"]
"enum": ["always", "never", "from-visited"]
},
"ExpireAtSessionEnd": {
@ -149,13 +142,6 @@
}
},
"CreateMasterPassword": {
"description": "If false, removes access to create a master password.",
"first_available": "60.0",
"type": "boolean"
},
"DisableAppUpdate": {
"description": "Prevent the browser from updating.",
"first_available": "60.0",
@ -220,6 +206,13 @@
"type": "boolean"
},
"DisableMasterPasswordCreation": {
"description": "If true, removes access to create a master password.",
"first_available": "60.0",
"type": "boolean"
},
"DisablePocket": {
"description": "Prevents ability to save webpages to Pocket.",
"first_available": "60.0",
@ -249,7 +242,7 @@
},
"DisableSafeMode": {
"description": "Prevents ability to restart in safe mode.",
"description": "Prevents ability to restart in safe mode. You can only prevent the Shift key by using GPO on Windows.",
"first_available": "60.0",
"type": "boolean"
@ -271,7 +264,14 @@
}
},
"DisableSysAddonUpdate": {
"DisableSetDesktopBackground": {
"description": "Prevents usage of the \"Set Image as Desktop Background\" feature.",
"first_available": "60.0",
"type": "boolean"
},
"DisableSystemAddonUpdate": {
"description": "Prevent the browser from installing and updating system addons.",
"first_available": "60.0",
"enterprise_only": true,
@ -405,8 +405,8 @@
"required": ["URL"]
},
"InstallAddons": {
"description": "Allow or deny popup websites to install webextensions.",
"InstallAddonsPermission": {
"description": "Allow webites to install add-ons.",
"first_available": "60.0",
"type": "object",
@ -430,6 +430,13 @@
"type": "boolean"
},
"OfferToSaveLogins": {
"description": "Enforces the setting to allow Firefox to offer to remember saved logins and passwords. Both true and false values are accepted.",
"first_available": "60.0",
"type": "boolean"
},
"OverrideFirstRunPage": {
"description": "Override the first run page. Set this policy to blank if you want to disable the first run page.",
"first_available": "60.0",
@ -527,13 +534,6 @@
}
},
"RememberPasswords": {
"description": "Enforces the setting to allow Firefox to remember saved logins and passwords. Both true and false values are accepted.",
"first_available": "60.0",
"type": "boolean"
},
"SanitizeOnShutdown": {
"description": "Clears ALL browser data on shutdown.",
"first_available": "60.0",

Просмотреть файл

@ -31,11 +31,11 @@ const POLICIES_TESTS = [
// POLICY: RememberPasswords
{
policies: { "RememberPasswords": false },
policies: { "OfferToSaveLogins": false },
lockedPrefs: { "signon.rememberSignons": false },
},
{
policies: { "RememberPasswords": true },
policies: { "OfferToSaveLogins": true },
lockedPrefs: { "signon.rememberSignons": true },
},
@ -122,7 +122,7 @@ const POLICIES_TESTS = [
// POLICY: InstallAddons.Default (block addon installs)
{
policies: {
"InstallAddons": {
"InstallAddonsPermission": {
"Default": false,
}
},

Просмотреть файл

@ -5,7 +5,7 @@
add_task(async function setup() {
await setupPolicyEngineWithJson({
"policies": {
"BlockSetDesktopBackground": true
"DisableSetDesktopBackground": true
}
});
});

Просмотреть файл

@ -132,7 +132,7 @@ add_task(async function test_third_party_disabled() {
await setupPolicyEngineWithJson({
"policies": {
"Cookies": {
"AcceptThirdParty": "none"
"AcceptThirdParty": "never"
}
}
});
@ -151,7 +151,7 @@ add_task(async function test_disabled_and_third_party_disabled() {
"policies": {
"Cookies": {
"Default": false,
"AcceptThirdParty": "none"
"AcceptThirdParty": "never"
}
}
});
@ -170,7 +170,7 @@ add_task(async function test_disabled_and_third_party_disabled_locked() {
"policies": {
"Cookies": {
"Default": false,
"AcceptThirdParty": "none",
"AcceptThirdParty": "never",
"Locked": true
}
}
@ -245,7 +245,7 @@ add_task(async function test_disabled_cookie_expire_locked() {
"policies": {
"Cookies": {
"Default": false,
"AcceptThirdParty": "none",
"AcceptThirdParty": "never",
"ExpireAtSessionEnd": true,
"Locked": true
}

Просмотреть файл

@ -53,11 +53,11 @@ add_task(async function test_policy_disable_masterpassword() {
await setupPolicyEngineWithJson({
"policies": {
"CreateMasterPassword": false
"DisableMasterPasswordCreation": true
}
});
// With the `CreateMasterPassword: false` policy active, the
// With the `DisableMasterPasswordCreation: true` policy active, the
// UI entry points for creating a Master Password should be disabled.
await checkDeviceManager({buttonIsDisabled: true});
await checkAboutPreferences({checkboxIsDisabled: true});

Просмотреть файл

@ -19,7 +19,7 @@
]
},
"InstallAddons": {
"InstallAddonsPermission": {
"Allow": [
"https://www.allow.com",
"https://www.pre-existing-deny.com"