Bug 809944 - Require access fields in manifests. r=bent, a=blocking-basecamp
authorGregor Wagner <anygregor@gmail.com>
Mon, 19 Nov 2012 12:31:09 -0800
changeset 122380 ac67728fb89b347dc29d47d72c333f442e5cece6
parent 122379 3bf830f79d496a4c20c6d52e647a77ad21246b2f
child 122381 6c776a1f9392758abcc23ecdcdf63e61f1b9c63b
push id273
push userlsblakk@mozilla.com
push dateThu, 14 Feb 2013 23:19:38 +0000
treeherdermozilla-release@c5e807a3f8b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent, blocking-basecamp
bugs809944
milestone19.0a2
Bug 809944 - Require access fields in manifests. r=bent, a=blocking-basecamp
dom/apps/src/PermissionsInstaller.jsm
dom/contacts/tests/test_contacts_basics.html
--- a/dom/apps/src/PermissionsInstaller.jsm
+++ b/dom/apps/src/PermissionsInstaller.jsm
@@ -277,25 +277,22 @@ this.expandPermissions = function expand
   const tableEntry = PermissionsTable[aPermName];
 
   if (tableEntry.substitute && tableEntry.additional) {
     Cu.reportError("PermissionsTable.jsm: expandPermissions: Can't handle both 'substitute' " +
                    "and 'additional' entries for permission: " + aPermName);
     return [];
   }
 
-/*
-Temporarily disabled in order to add access fields to gaia: See Bug 805646
   if (!aAccess && tableEntry.access ||
       aAccess && !tableEntry.access) {
     Cu.reportError("PermissionsTable.jsm: expandPermissions: Invalid Manifest : " +
                    aPermName + " " + aAccess + "\n");
     throw new Error("PermissionsTable.jsm: expandPermissions: Invalid Manifest");
   }
-*/
 
   let expandedPerms = [];
 
   if (tableEntry.access && aAccess) {
   let requestedSuffixes = [];
     switch (aAccess) {
   case READONLY:
     requestedSuffixes.push("read");
@@ -308,38 +305,26 @@ Temporarily disabled in order to add acc
     break;
   case READWRITE:
     requestedSuffixes.push("read", "create", "write");
     break;
   default:
     return [];
   }
 
-    // XXXbent This is a temporary hack! Remove this whole block once the
-    //         Settings API and the DeviceStorage API have stopped checking just
-    //         the bare permission (e.g. "settings" vs. "settings-read").
-    if (true) {
-      expandedPerms.push(aPermName);
-      if (tableEntry.additional) {
-        for each (let additional in tableEntry.additional) {
-          expandedPerms.push(additional);
-        }
-      }
-    }
-
   let permArr = mapSuffixes(aPermName, requestedSuffixes);
 
-    // Add the same suffix to each of the additions.
-    if (tableEntry.additional) {
-      for each (let additional in tableEntry.additional) {
-        permArr = permArr.concat(mapSuffixes(additional, requestedSuffixes));
-      }
+  // Add the same suffix to each of the additions.
+  if (tableEntry.additional) {
+    for each (let additional in tableEntry.additional) {
+      permArr = permArr.concat(mapSuffixes(additional, requestedSuffixes));
     }
+  }
 
-    // Only add the suffixed version if the suffix exisits in the table.
+  // Only add the suffixed version if the suffix exisits in the table.
   for (let idx in permArr) {
       let suffix = requestedSuffixes[idx % requestedSuffixes.length];
       if (tableEntry.access.indexOf(suffix) != -1) {
       expandedPerms.push(permArr[idx]);
     }
   }
   } else if (tableEntry.substitute) {
     expandedPerms = expandedPerms.concat(tableEntry.substitute);
--- a/dom/contacts/tests/test_contacts_basics.html
+++ b/dom/contacts/tests/test_contacts_basics.html
@@ -226,17 +226,17 @@ function checkContacts(contact1, contact
     }
     checkField(contact1.impp[i], contact2.impp[i]);
   }
 }
 
 var req;
 var index = 0;
 
-var mozContacts = window.navigator.mozContacts
+var mozContacts = window.navigator.mozContacts;
 
 var steps = [
   function () {
     ok(true, "Deleting database");
     req = mozContacts.clear();
     req.onsuccess = function () {
       ok(true, "Deleted the database");
       next();