Merge lp:~gz/hydrazine/ask_write_private_access_only_643610 into lp:hydrazine

Proposed by Martin Packman
Status: Merged
Approved by: Martin Pool
Approved revision: 92
Merged at revision: 98
Proposed branch: lp:~gz/hydrazine/ask_write_private_access_only_643610
Merge into: lp:hydrazine
Diff against target: 22 lines (+12/-0)
1 file modified
hydrazine/__init__.py (+12/-0)
To merge this branch: bzr merge lp:~gz/hydrazine/ask_write_private_access_only_643610
Reviewer Review Type Date Requested Status
Martin Pool Approve
Vincent Ladeuil (community) Approve
Review via email: mp+78739@code.launchpad.net

Description of the change

Avoid some user confusion by only asking for "Change anything" access to launchpad, rather than giving them the option of shooting themselves in the foot by picking something else. It would be nice if there was way to not ask for full privileges all the time, but we have to work with what launchpadlib offers. As poolie says in the bug, the scripts in hydrazine run under direct command of the user and they can look at the source, so it's not too big of a worry.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) :
review: Approve
Revision history for this message
Martin Pool (mbp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hydrazine/__init__.py'
2--- hydrazine/__init__.py 2011-04-06 04:02:04 +0000
3+++ hydrazine/__init__.py 2011-10-09 00:18:24 +0000
4@@ -30,6 +30,18 @@
5 #
6 # NB: Generally naming the parameters seems safer, but in this case the
7 # first changed from 'consumer_name' to 'application_name' in natty.
8+ #
9+ # Specify WRITE_PRIVATE access so the user doesn't get a confusing list of
10+ # options then a strange HTTP error later if they picked read-only. See:
11+ #
12+ # <http://pad.lv/643610>
13+ # <http://jameswestby.net/weblog/tech/16-Improving-the-usability-of-launchpadlib-using-code.html>
14+ #
15+ # Unfortunately launchpadlib doesn't detect if existing credentials have
16+ # insufficient access so we can't ask for lesser permissions then upgrade
17+ # as required later. As hydrazine runs under direct control of the user,
18+ # always having the ability to change everything isn't too bad.
19 return Launchpad.login_with(
20 'hydrazine',
21+ allow_access_levels=['WRITE_PRIVATE'],
22 service_root=LPNET_SERVICE_ROOT)

Subscribers

People subscribed via source and target branches

to all changes: