Last Comment Bug 710548 - Add the offline-app, webapp-manage permissions to pre-installed apps.
: Add the offline-app, webapp-manage permissions to pre-installed apps.
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: General (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
:
Mentors:
Depends on:
Blocks: 709468
  Show dependency treegraph
 
Reported: 2011-12-13 22:17 PST by Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
Modified: 2011-12-14 12:06 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Add offline-app, webapp-manage permissions to pre-installed app (2.92 KB, patch)
2011-12-13 22:17 PST, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
cjones.bugs: review+
Details | Diff | Review
Patch for check-in (4.37 KB, patch)
2011-12-14 08:47 PST, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
no flags Details | Diff | Review
Patch for check-in (4.38 KB, patch)
2011-12-14 11:39 PST, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
no flags Details | Diff | Review

Description Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-13 22:17:52 PST
Created attachment 581540 [details] [diff] [review]
Add offline-app, webapp-manage permissions to pre-installed app
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-12-14 07:13:13 PST
Comment on attachment 581540 [details] [diff] [review]
Add offline-app, webapp-manage permissions to pre-installed app

>diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js

>+// XXX until we have a security model, add some rights to
>+// the pre-installed web applications 
>+function addPermissions(urls) {
>+  let permissions = ['indexedDB', 'webapps-manage', 'offline-app'];

Giving all app "webapps-manage" really sucks, but I understand why
you're doing it.  Instead of an XXX here, let's find a bug to link
here with a FIXME comment, or push on Jonas/WebAPI team to file one.

>@@ -251,10 +258,18 @@ var shell = {
>             return;
> 
>           let documentURI = contentWindow.document.documentURIObject;
>-          let manifestURI = Services.io.newURI(manifest, null, documentURI);
>+          if (!Services.perms.testPermission(documentURI, 'offline-app')) {
>+            if (Services.prefs.getBoolPref('browser.offline-apps.notify')) {
>+              // TODO Add code to handle the notification UI

"FIXME/bug XXXXXX: [blah]"

r=me with those fixes.
Comment 2 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-14 08:47:59 PST
Created attachment 581654 [details] [diff] [review]
Patch for check-in
Comment 3 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-14 11:39:25 PST
Created attachment 581727 [details] [diff] [review]
Patch for check-in
Comment 4 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-14 12:06:18 PST
http://hg.mozilla.org/mozilla-central/rev/fe5bd75f1553

Note You need to log in before you can comment on or make changes to this bug.