зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1084505 - Fix explicit permission lookup for trusted hosted apps r=fabrice
This commit is contained in:
Родитель
642bb1a6ff
Коммит
dfb7fb4437
|
@ -668,7 +668,7 @@ this.AllPossiblePermissions = [];
|
|||
AllPossiblePermissions.concat(["indexedDB", "offline-app", "pin-app"]);
|
||||
})();
|
||||
|
||||
this.isExplicitInPermissionsTable = function(aPermName, aIntStatus) {
|
||||
this.isExplicitInPermissionsTable = function(aPermName, aIntStatus, aAppKind) {
|
||||
|
||||
// Check to see if the 'webapp' is app/privileged/certified.
|
||||
let appStatus;
|
||||
|
@ -680,7 +680,7 @@ this.isExplicitInPermissionsTable = function(aPermName, aIntStatus) {
|
|||
appStatus = "privileged";
|
||||
break;
|
||||
default: // If it isn't certified or privileged, it's app
|
||||
appStatus = "app";
|
||||
appStatus = aAppKind == "hosted-trusted" ? "trusted" : "app";
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* We expose Gecko-internal helpers related to "web apps" through this
|
||||
* sub-interface.
|
||||
*/
|
||||
[scriptable, uuid(1d856b11-ac29-47d3-bd52-a86e3d45fcf4)]
|
||||
[scriptable, uuid(1d856b11-ac29-47d3-bd52-a86e3d45fcf5)]
|
||||
interface mozIApplication: nsISupports
|
||||
{
|
||||
/* Return true if this app has |permission|. */
|
||||
|
@ -55,4 +55,7 @@ interface mozIApplication: nsISupports
|
|||
|
||||
/* role copied from the manifest */
|
||||
readonly attribute DOMString role;
|
||||
|
||||
/* Returns the kind of the app. */
|
||||
readonly attribute DOMString kind;
|
||||
};
|
||||
|
|
|
@ -61,10 +61,13 @@ PermissionSettings.prototype = {
|
|||
aBrowserFlag) {
|
||||
debug("isExplicit: " + aPermName + ", " + aManifestURL + ", " + aOrigin);
|
||||
let uri = Services.io.newURI(aOrigin, null, null);
|
||||
let appID = appsService.getAppLocalIdByManifestURL(aManifestURL);
|
||||
let principal = Services.scriptSecurityManager.getAppCodebasePrincipal(uri, appID, aBrowserFlag);
|
||||
let app = appsService.getAppByManifestURL(aManifestURL);
|
||||
let principal = Services.scriptSecurityManager
|
||||
.getAppCodebasePrincipal(uri, app.localId, aBrowserFlag);
|
||||
|
||||
return isExplicitInPermissionsTable(aPermName, principal.appStatus);
|
||||
return isExplicitInPermissionsTable(aPermName,
|
||||
principal.appStatus,
|
||||
app.kind);
|
||||
},
|
||||
|
||||
set: function set(aPermName, aPermValue, aManifestURL, aOrigin,
|
||||
|
|
Загрузка…
Ссылка в новой задаче