Bug 1295151 - Install add-on should not show as a permission in the control center; r=MattN

MozReview-Commit-ID: ChkG0AU743W

--HG--
extra : rebase_source : 8893ad623896881f888239b810f90f0449c7637f
This commit is contained in:
Fred Lin 2016-09-19 15:03:46 +08:00
parent 63e75ca24b
commit 2088e1ede1
2 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,8 @@ this.SitePermissions = {
*
* To receive a more detailed, albeit less performant listing see
* SitePermissions.getPermissionDetailsByURI().
*
* install addon permission is excluded, check bug 1303108
*/
getAllByURI: function (aURI) {
let result = [];
@ -37,6 +39,10 @@ this.SitePermissions = {
// filter out unknown permissions
if (gPermissionObject[permission.type]) {
// XXX Bug 1303108 - Control Center should only show non-default permissions
if (permission.type == "install") {
continue;
}
result.push({
id: permission.type,
state: permission.capability,

View File

@ -45,6 +45,11 @@ add_task(function* testGetAllByURI() {
SitePermissions.remove(uri, "camera");
SitePermissions.remove(uri, "desktop-notification");
Assert.deepEqual(SitePermissions.getAllByURI(uri), []);
// XXX Bug 1303108 - Control Center should only show non-default permissions
SitePermissions.set(uri, "addon", SitePermissions.BLOCK);
Assert.deepEqual(SitePermissions.getAllByURI(uri), []);
SitePermissions.remove(uri, "addon");
});
add_task(function* testGetPermissionDetailsByURI() {