Closed Bug 117228 Opened 23 years ago Closed 23 years ago

Filepicker should use mode to do permissions checking

Categories

(SeaMonkey :: UI Design, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

We seem to be getting a lot of bugs on lack of error dialogs when file writes fail and the like. nsIFilePicker::init() already takes a "mode" argument. It would make sense for the filepicker itself to use this mode argument to do permissions checking and to simply not allow selection of a file with incorrect permissions. modeOpen -- the filepicker should allow only selection of files that the user has permissions to read (test with an open() call?) modeSave -- the filepicker should allow only selection of files in a directory in which the user can create files if the selected file doesn't already exist. If the file selected already exists the filepicker should only allow selecting it if it's writable by the user. modeGetFolder -- not really clear what to do here. It seems this would be better off as a flag that can be and-ed with the other two...
Blocks: 27609, 60063, 85309
methinks this is similar to bug 115197, which i think was a regression recently introduced with the new save page features. will need to check back on 115197 --but do let me know whether this is completely different [or related].
Assignee: pchen → ben
Blocks: 115197
This is nothing like bug 115197. Bug 115197 is a result of a consumer of the filepicker (the save as code) not checking permissions. This bug is a request to move permissions-checking into the filepicker, where I feel it belongs, so that consumers of the picker will not need to check permissions themselves. This would fix a number of bugs, including the bugs this blocks and a similar bug about permissions issues when printing, which I can't find at the moment.
Depends on: 114399
taking
Assignee: ben → bzbarsky
Keywords: patch, review
Comment on attachment 65705 [details] [diff] [review] patch to fix file opening (which was not done in bug 114399) and some cleanup r=bryner, looks good
Attachment #65705 - Flags: review+
Comment on attachment 65705 [details] [diff] [review] patch to fix file opening (which was not done in bug 114399) and some cleanup sr=jag
Attachment #65705 - Flags: superreview+
Priority: -- → P1
Target Milestone: --- → mozilla0.9.9
checked into trunk.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
rs vrfy
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: