Bug 1428922 - Implement cookies policy. r=mystor
MozReview-Commit-ID: 9MDgoXZM7fy
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -76,16 +76,22 @@ this.Policies = {
}
},
"install_addons": {
onBeforeUIStartup(manager, param) {
PermissionPolicies.addAllowDenyPermissions("install", param.allow, param.block);
}
},
+
+ "cookies": {
+ onBeforeUIStartup(manager, param) {
+ PermissionPolicies.addAllowDenyPermissions("cookie", param.allow, param.block);
+ }
+ },
};
function validateAndParseParamRecursive(param, properties) {
if (properties.enum) {
if (properties.enum.includes(param)) {
return [true, param];
}
return [false, null];
--- a/browser/components/enterprisepolicies/schemas/policies.json
+++ b/browser/components/enterprisepolicies/schemas/policies.json
@@ -88,11 +88,33 @@
"block": {
"type": "array",
"items": {
"type": "origin"
}
}
}
+ },
+
+ "cookies": {
+ "description": "Allow or deny websites to set cookies.",
+ "first_available": "60.0",
+
+ "type": "object",
+ "properties": {
+ "allow": {
+ "type": "array",
+ "items": {
+ "type": "origin"
+ }
+ },
+
+ "block": {
+ "type": "array",
+ "items": {
+ "type": "origin"
+ }
+ }
+ }
}
}
}