Merge lp:~abentley/launchpad/restricted-diffs into lp:launchpad
| Status: | Merged | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Merged at revision: | not available | ||||||||
| Proposed branch: | lp:~abentley/launchpad/restricted-diffs | ||||||||
| Merge into: | lp:launchpad | ||||||||
| Diff against target: |
337 lines (+101/-21) 10 files modified
lib/canonical/launchpad/security.py (+24/-0) lib/lp/code/browser/configure.zcml (+5/-0) lib/lp/code/browser/diff.py (+10/-1) lib/lp/code/browser/tests/test_tales.py (+16/-15) lib/lp/code/configure.zcml (+3/-1) lib/lp/code/interfaces/diff.py (+3/-0) lib/lp/code/model/diff.py (+10/-2) lib/lp/code/model/tests/test_diff.py (+13/-0) lib/lp/code/stories/branches/xx-branchmergeproposals.txt (+15/-0) lib/lp/code/templates/branchmergeproposal-diff.pt (+2/-2) |
||||||||
| To merge this branch: | bzr merge lp:~abentley/launchpad/restricted-diffs | ||||||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Nelson (community) | code | 2010-02-18 | Approve on 2010-02-18 |
|
Review via email:
|
|||
| Aaron Bentley (abentley) wrote : | # |
| Michael Nelson (michael.nelson) wrote : | # |
Approve, just one missing blank line below, in addition to our IRC exchange.
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -10,10 +10,18 @@
>
>
> from canonical.launchpad import _
> +from canonical.
> +from canonical.
> +from canonical.
> from canonical.
> +from lp.code.
> from lp.services.
>
>
> +class PreviewDiffNavi
> +
> + usedfor = IPreviewDiff
> +
Just need an extra line here.
> class PreviewDiffForm
> """Formatter for preview diffs."""
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -614,10 +614,25 @@
> ... return find_tag_
>
> The text of the review diff is in the page.
> +
> >>> print repr(extract_
> u'Preview Diff\nDownload diff\n1\n...Fake Diff\u1010'
>
> +There is also a link to the diff URL, which is the preview diff URL plus
> +"+files/
> +
> + >>> link = get_review_
> + >>> print link['href']
> + http://
17:20 < noodles775> abentley: your branch looks great. The only question I
have is whether there's really a need to include each segment of the url in
the doctest:
http://
17:21 < abentley> noodles775, I would be fine with just showing "/+preview-
17:22 < noodles775> abentley: yeah (not that I care much either way, it'd just mean it was within 78chars :))
Thanks Aaron.

= Summary =
Fix bug #328271, "Use the restricted librarian for diffs for private branches".
== Proposed fix ==
Use the restricted librarian for diffs of all branches, and let the standard
security mechanisms decide who can view the diffs.
== Pre-implementation notes ==
None
== Implementation details ==
PreviewDiffs are now accessible via the +files path segment, with the same mechanism as Launchpad components.
IPreviewDiff access was allowed to anyone. Now it is only allowed to those who
can access the merge proposal.
== Tests == roposals. txt -t test_getFileByName
bin/test -vt xx-branchmergep
== Demo and Q/A ==
Create a private branch and propose it for merging. Wait until the diff is
generated. Go to the URL for the diff. Log out. Go to the URL for the diff.
You should get an access denied message.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: code/browser/ configure. zcml code/configure. zcml /launchpad/ security. py code/browser/ diff.py code/model/ diff.py code/stories/ branches/ xx-branchmergep roposals. txt code/model/ tests/test_ diff.py code/templates/ branchmergeprop osal-diff. pt code/interfaces /diff.py
lib/lp/
lib/lp/
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ code/model/ diff.py
18: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
210: [W0703, Diff.fromFile] Catch "Exception"
lib/lp/ code/interfaces /diff.py fields' (No module named restful) declarations' (No module named restful)
20: [F0401] Unable to import 'lazr.restful.
21: [F0401] Unable to import 'lazr.restful.