Merge lp:~adeuring/launchpad/bug-1086057 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Abel Deuring on 2012-12-05 |
| Approved revision: | no longer in the source branch. |
| Merge reported by: | Curtis Hovey |
| Merged at revision: | not available |
| Proposed branch: | lp:~adeuring/launchpad/bug-1086057 |
| Merge into: | lp:launchpad |
| To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-1086057 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Richard Harding (community) | 2012-12-05 | Approve on 2012-12-05 | |
|
Review via email:
|
|||
Commit Message
change permissions for IProductSeries so that users with an artifact grant for a bug for a private product and linked to a milestone or product series can view these bugs.
Description of the Change
fix for bug 1086057: Users with an artifact grant for a bug related to
a private product can't view the bug page
I filed this bug together with bug 1086043. The changes from the branch
that fixed 1086043 already allowed to view bugs of proprietary products,
when these bugs had only a bugtask for the product itself or when a
milestone is linked to the bugtask. Bugs with a task for a series of
the proprietary product needed some additional changes: Several
ProductSeries attributes need the permission lp.LimitedView instead
of lp.View.
These attributes are defined in IStructuralSubs
IBugTarget. registry/
for each attribute of these interfaces individually, not for the
entire interfaces, similar to the permission definitions for these
attributes in IProduct.
Tests:
./bin/test bugs -vvt test_bug_
./bin/test registry -vvt lp.registry.
no lint
| Abel Deuring (adeuring) wrote : | # |

here is the diff:
=== modified file 'lib/lp/ bugs/browser/ tests/test_ bug_views. py' bugs/browser/ tests/test_ bug_views. py 2012-11-12 11:33:18 +0000 bugs/browser/ tests/test_ bug_views. py 2012-12-05 09:52:53 +0000
bug. default_ bugtask, name='+activity')
view. render( )
self. assertThat( recorder, HasQueryCount( Equals( 7))) (BrowserTestCas e): nalLayer ugView, self).setUp() makePerson( ) makePerson( ) y_product = self.factory. makeProduct( product_ owner, type=Informatio nType.PROPRIETA RY) logged_ in(self. product_ owner): makeProductSeri es( self.proprietar y_product) makeMilestone( self.proprietar y_product) makeBug( self.proprietar y_product, owner=self. product_ owner) subscribe( self.user, subscribed_ by=self. product_ owner) page_user_ with_aag_ proprietary_ product( self): logged_ in(self. user): url(self. bug) wser(url, user=self.user) page_user_ with_aag_ proprietary_ product_ milestone_ linked( self): logged_ in(self. product_ owner): default_ bugtask. transitionToMil estone( logged_ in(self. user): url(self. bug) wser(url, user=self.user) page_user_ with_aag_ proprietary_ product_ task_for_ series( self): logged_ in(self. product_ owner): makeBugTask( logged_ in(self. user): url(self. bug) wser(url, user=self.user)
--- lib/lp/
+++ lib/lp/
@@ -752,3 +752,55 @@
+
+
+class TestMainBugView
+
+ layer = DatabaseFunctio
+
+ def setUp(self):
+ super(TestMainB
+ self.user = self.factory.
+ self.product_owner = self.factory.
+ self.proprietar
+ owner=self.
+ information_
+ with person_
+ self.series = self.factory.
+ product=
+ self.milestone = self.factory.
+ product=
+ self.bug = self.factory.
+ target=
+ self.bug.
+
+ def test_bug_
+ # A user with an artifact grant for a bug targeted to a private
+ # product can view the bug page.
+ with person_
+ url = canonical_
+ # No exception is raised when the page is rendered.
+ self.getUserBro
+
+ def test_bug_
+ # A user with an artifact grant for a bug targeted to a private
+ # product can view the bug page, even if the bug is linked to
+ # milestone.
+ with person_
+ self.bug.
+ self.milestone, self.product_owner)
+ with person_
+ url = canonical_
+ # No exception is raised when the page is rendered.
+ self.getUserBro
+
+ def test_bug_
+ # A user with an artifact grant for a bug targeted to a private
+ # product series can view the bug page.
+ with person_
+ self.factory.
+ bug=self.bug, target=self.series)
+ with person_
+ url = canonical_
+ # No exception is raised when the page is rendered.
+ self.getUserBro
=== modified file 'lib/lp/ registry/ configure. zcml' registry/ configure. zcml 2012-12-04 13:52:02 +0000 registry/ configure. zcml 2012-12-05 09:49:10 +0000
productserie s
series_ target
summary
"/>
--- lib/lp/
+++ lib/lp/
@@ -1045,7 +1045,6 @@
- title
<require
pe...