Bug 809944 - Require access fields in manifests. r=bent

This commit is contained in:
Gregor Wagner 2012-11-19 12:31:09 -08:00
Родитель 2b76da943f
Коммит 04ddaeaf6d
2 изменённых файлов: 7 добавлений и 22 удалений

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

@ -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) {

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

@ -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 () {