Merge lp:~jcsackett/launchpad/bad-bugtasks-how-dare-you-break-details into lp:launchpad
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | no longer in the source branch. |
Merged at revision: | 15071 |
Proposed branch: | lp:~jcsackett/launchpad/bad-bugtasks-how-dare-you-break-details |
Merge into: | lp:launchpad |
Diff against target: |
195 lines (+77/-31) 2 files modified
lib/lp/registry/browser/pillar.py (+46/-23) lib/lp/registry/browser/tests/test_pillar_sharing.py (+31/-8) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/bad-bugtasks-how-dare-you-break-details |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Kowalik (community) | code | Approve | |
Review via email:
|
Commit message
Filters out bugs the user doesn't have authorization to see in the sharing details view.
Description of the change
Summary
=======
The sharing details view currently attempts to show all shared bugs in a
project. However, as the details view requires a permission of
`launchpad.Driver`, bugs exist that cannot be seen by everyone who can see
sharing details.
To remedy this, bugs should be filtered using the searching machinery to
safely filter out anything that the user shouldn't be able to see.
Preimp
======
Spoke with William Grant.
Additional discussion can be found in the #launchpad-dev irclogs. [1]
Implementation
==============
The bug ids found by querying the flattened artifact source are now passed
into a new method which uses `BugTaskSet.search` to get back a list of safe
bugtasks. These are then used to build the mustache data.
Additionally, testing this branch demonstrated that if an artifact was shared
via two policies, it would be listed twice; as a drive by, this branch
switches to using sets to accumulate the artifacts rather than lists,
preventing duplication.
Tests
=====
bin/test -vvct pillar_sharing
QA
==
Open https:/
should open safely, showing only bugs you, as the user, should be able to see.
Lint
====
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
[1]: http://
This looks like great work, my only concerns are the imports you've added on lines 11 to 17 of the diff -- I'd like to see a comment explaining circular imports, and I really don't think the zope import belongs there at all. Please try and move the imports if you can, but I won't block on it.