Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Issue 9741002: Adding file access permissions to fileBrowserHandler manifest. (Closed)

Created:
8 years, 9 months ago by tbarzic
Modified:
8 years, 9 months ago
CC:
chromium-reviews, nkostylev+watch_chromium.org, mihaip+watch_chromium.org, Aaron Boodman, rginda+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, michaeln
Visibility:
Public.

Description

Adding read, read-write and create file access permission to fileBrowserHandler manifest. added file_access property to file_browser_handlers the property is list of enum {"read", "read-write", "create"} values. The property is optional and it's default value is read-write "create" value must be alone in the list. If "create" is specified, file_filters property is ignored. design doc (part 1 only): https://docs.google.com/a/google.com/document/d/10ZWbisYfxz4jSvvN534p7fPyFFRrmwDtA1RaJN7VDl4/edit (part 2 needs some more work, it's targeted for R20) BUG=chromium-os:26106 TEST=unit/browser : *FileBrowser* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=129112

Patch Set 1 #

Patch Set 2 : make win_rel happy #

Patch Set 3 : forgot manifest test files... #

Patch Set 4 : . #

Patch Set 5 : rebase #

Patch Set 6 : fix browser tests #

Patch Set 7 : .. #

Total comments: 14

Patch Set 8 : . #

Patch Set 9 : . #

Patch Set 10 : unit_tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -59 lines) Patch
M chrome/browser/chromeos/extensions/external_filesystem_apitest.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_handler_util.cc View 1 2 3 4 5 6 7 6 chunks +35 lines, -7 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 3 4 5 6 7 8 1 chunk +54 lines, -27 lines 0 comments Download
M chrome/common/extensions/extension_manifest_constants.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_manifest_constants.cc View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_manifests_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +24 lines, -0 lines 0 comments Download
M chrome/common/extensions/file_browser_handler.h View 1 2 3 4 5 6 7 8 2 chunks +17 lines, -0 lines 0 comments Download
M chrome/common/extensions/file_browser_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +64 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/filebrowser_component/main.js View 4 chunks +17 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/filebrowser_component/read.js View 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/filebrowser_component/write.js View 2 chunks +30 lines, -6 lines 0 comments Download
M chrome/test/data/extensions/api_test/filesystem_handler_write/manifest.json View 2 chunks +6 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/filesystem_handler_write/tab.js View 2 chunks +6 lines, -6 lines 0 comments Download
A chrome/test/data/extensions/manifest_tests/filebrowser_invalid_access_permission.json View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/manifest_tests/filebrowser_invalid_access_permission_list.json View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/manifest_tests/filebrowser_invalid_empty_access_permission_list.json View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/manifest_tests/filebrowser_valid_with_create.json View 1 2 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
tbarzic
Aaron, can you take a look? This is for the part of the api review ...
8 years, 9 months ago (2012-03-20 18:56:53 UTC) #1
Aaron Boodman
.redirect("yoz")
8 years, 9 months ago (2012-03-26 18:11:12 UTC) #2
Yoyo Zhou
Mostly LG, but with a few comments. http://codereview.chromium.org/9741002/diff/19004/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): http://codereview.chromium.org/9741002/diff/19004/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode113 chrome/browser/chromeos/extensions/file_handler_util.cc:113: if (action_iter->get()->id() ...
8 years, 9 months ago (2012-03-26 22:42:58 UTC) #3
tbarzic
https://chromiumcodereview.appspot.com/9741002/diff/19004/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://chromiumcodereview.appspot.com/9741002/diff/19004/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode113 chrome/browser/chromeos/extensions/file_handler_util.cc:113: if (action_iter->get()->id() == action_id) On 2012/03/26 22:42:58, Yoyo Zhou ...
8 years, 9 months ago (2012-03-26 23:22:51 UTC) #4
Yoyo Zhou
LGTM https://chromiumcodereview.appspot.com/9741002/diff/19004/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://chromiumcodereview.appspot.com/9741002/diff/19004/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode113 chrome/browser/chromeos/extensions/file_handler_util.cc:113: if (action_iter->get()->id() == action_id) On 2012/03/26 23:22:51, tbarzic ...
8 years, 9 months ago (2012-03-27 00:54:19 UTC) #5
tbarzic
8 years, 9 months ago (2012-03-27 01:10:59 UTC) #6
Thanks for the review!

http://codereview.chromium.org/9741002/diff/19004/chrome/browser/chromeos/ext...
File chrome/browser/chromeos/extensions/file_handler_util.cc (right):

http://codereview.chromium.org/9741002/diff/19004/chrome/browser/chromeos/ext...
chrome/browser/chromeos/extensions/file_handler_util.cc:113: if
(action_iter->get()->id() == action_id)
On 2012/03/27 00:54:20, Yoyo Zhou wrote:
> On 2012/03/26 23:22:51, tbarzic wrote:
> > On 2012/03/26 22:42:58, Yoyo Zhou wrote:
> > > These ids look like they're user-provided, but I don't see what ensures
the
> > ids
> > > are unique.
> > 
> > I don't think there is anything..
> 
> So you may have unexpected results if the ids are not unique. But this is
> probably not a big deal.

Yeah.. I'll try to address this as I implement new way of specifying file
filters (part 2 of the design doc).. should not be too hard

http://codereview.chromium.org/9741002/diff/19004/chrome/common/extensions/fi...
File chrome/common/extensions/file_browser_handler.cc (right):

http://codereview.chromium.org/9741002/diff/19004/chrome/common/extensions/fi...
chrome/common/extensions/file_browser_handler.cc:86: bool
FileBrowserHandler::CanCreate() const {
On 2012/03/27 00:54:20, Yoyo Zhou wrote:
> On 2012/03/26 23:22:51, tbarzic wrote:
> > On 2012/03/26 22:42:58, Yoyo Zhou wrote:
> > > Does write access imply being able to create? Do you intend for this to be
> > used
> > > to check "has the create file access permission" or to check "can create
> > files"?
> > > (In other words, if I want to be able to both edit files and create new
> files,
> > > what should I specify?)
> > 
> > I plan to use this as check that the handler "has the create file access
> > permission".
> > The write permission could also imply create permission (in save as use
case),
> > but I'm not completely sure how we're going to implement this yet (we may
also
> > check that the handler has at least on "create" handler specified).
> > 
> > Maybe it would be good to rename this?
> 
> Yeah, my comment is along the lines of: the functionality might not match the
> name, so either the name or the functionality should change.

Done.

Powered by Google App Engine
This is Rietveld 408576698