From 04ddaeaf6d3e9f42bd8cbfa338bd8574212ab68e Mon Sep 17 00:00:00 2001 From: Gregor Wagner Date: Mon, 19 Nov 2012 12:31:09 -0800 Subject: [PATCH] Bug 809944 - Require access fields in manifests. r=bent --- dom/apps/src/PermissionsInstaller.jsm | 27 +++++--------------- dom/contacts/tests/test_contacts_basics.html | 2 +- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/dom/apps/src/PermissionsInstaller.jsm b/dom/apps/src/PermissionsInstaller.jsm index 1959cac8ac2e..c3f0015546ee 100644 --- a/dom/apps/src/PermissionsInstaller.jsm +++ b/dom/apps/src/PermissionsInstaller.jsm @@ -282,15 +282,12 @@ this.expandPermissions = function expandPermissions(aPermName, aAccess) { 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 = []; @@ -313,28 +310,16 @@ Temporarily disabled in order to add access fields to gaia: See Bug 805646 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) { diff --git a/dom/contacts/tests/test_contacts_basics.html b/dom/contacts/tests/test_contacts_basics.html index d33f590f38e4..73f86a82c0dc 100644 --- a/dom/contacts/tests/test_contacts_basics.html +++ b/dom/contacts/tests/test_contacts_basics.html @@ -231,7 +231,7 @@ function checkContacts(contact1, contact2) { var req; var index = 0; -var mozContacts = window.navigator.mozContacts +var mozContacts = window.navigator.mozContacts; var steps = [ function () {