Bug 1428922 - Implement cookies policy. r=mystor draft
authorFelipe Gomes <felipc@gmail.com>
Fri, 12 Jan 2018 19:54:46 -0200
changeset 719903 4d9430d40dfafebad3382f647c3aa6e082b1eb0c
parent 719902 7793154b0e6bcbfd0da971291f5c12c1a4eac863
child 719904 7f68f584ba72eee9ae2de36db602e7dcd7bc9bd4
push id95389
push userfelipc@gmail.com
push dateFri, 12 Jan 2018 21:55:40 +0000
reviewersmystor
bugs1428922
milestone59.0a1
Bug 1428922 - Implement cookies policy. r=mystor MozReview-Commit-ID: 9MDgoXZM7fy
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/schemas/policies.json
--- 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"
+          }
+        }
+      }
     }
   }
 }