← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~adeuring/launchpad/bug-1086057 into lp:launchpad

 

here is the diff:

=== modified file 'lib/lp/bugs/browser/tests/test_bug_views.py'
--- lib/lp/bugs/browser/tests/test_bug_views.py	2012-11-12 11:33:18 +0000
+++ lib/lp/bugs/browser/tests/test_bug_views.py	2012-12-05 09:52:53 +0000
@@ -752,3 +752,55 @@
                 bug.default_bugtask, name='+activity')
             view.render()
         self.assertThat(recorder, HasQueryCount(Equals(7)))
+
+
+class TestMainBugView(BrowserTestCase):
+
+    layer = DatabaseFunctionalLayer
+
+    def setUp(self):
+        super(TestMainBugView, self).setUp()
+        self.user = self.factory.makePerson()
+        self.product_owner = self.factory.makePerson()
+        self.proprietary_product = self.factory.makeProduct(
+            owner=self.product_owner,
+            information_type=InformationType.PROPRIETARY)
+        with person_logged_in(self.product_owner):
+            self.series = self.factory.makeProductSeries(
+                product=self.proprietary_product)
+            self.milestone = self.factory.makeMilestone(
+                product=self.proprietary_product)
+            self.bug = self.factory.makeBug(
+                target=self.proprietary_product, owner=self.product_owner)
+            self.bug.subscribe(self.user, subscribed_by=self.product_owner)
+
+    def test_bug_page_user_with_aag_proprietary_product(self):
+        # A user with an artifact grant for a bug targeted to a private
+        # product can view the bug page.
+        with person_logged_in(self.user):
+            url = canonical_url(self.bug)
+            # No exception is raised when the page is rendered.
+            self.getUserBrowser(url, user=self.user)
+
+    def test_bug_page_user_with_aag_proprietary_product_milestone_linked(self):
+        # 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_logged_in(self.product_owner):
+            self.bug.default_bugtask.transitionToMilestone(
+                self.milestone, self.product_owner)
+        with person_logged_in(self.user):
+            url = canonical_url(self.bug)
+            # No exception is raised when the page is rendered.
+            self.getUserBrowser(url, user=self.user)
+
+    def test_bug_page_user_with_aag_proprietary_product_task_for_series(self):
+        # A user with an artifact grant for a bug targeted to a private
+        # product series can view the bug page.
+        with person_logged_in(self.product_owner):
+            self.factory.makeBugTask(
+                bug=self.bug, target=self.series)
+        with person_logged_in(self.user):
+            url = canonical_url(self.bug)
+            # No exception is raised when the page is rendered.
+            self.getUserBrowser(url, user=self.user)

=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml	2012-12-04 13:52:02 +0000
+++ lib/lp/registry/configure.zcml	2012-12-05 09:49:10 +0000
@@ -1045,7 +1045,6 @@
                 productseries
                 series_target
                 summary
-                title
                 "/>
         <require
             permission="launchpad.LimitedView"
@@ -1053,6 +1052,7 @@
                 displayname
                 name
                 target
+                title
                 "/>
         <require
             permission="launchpad.Edit"
@@ -1581,7 +1581,7 @@
             permission="launchpad.View"
             interface="lp.bugs.interfaces.bugsummary.IBugSummaryDimension"/>
         <require
-            permission="launchpad.View"
+            permission="launchpad.LimitedView"
             interface="lp.bugs.interfaces.bugtarget.ISeriesBugTarget"/>
         <require
             permission="launchpad.Edit"
@@ -1596,15 +1596,45 @@
             set_attributes="importstatus rcstype cvsroot cvsmodule
                             cvstarfileurl cvsbranch svnrepository"/>
 
-        <!-- IStructuralSubscriptionTarget -->
+        <!-- IStructuralSubscriptionTarget
 
+             Most attributes of IStructuralSubscriptionTargetRead require
+             launchpad.View, some require launchpad.LimitedView -->
+        <require
+            permission="launchpad.LimitedView"
+            attributes="
+                parent_subscription_target"/>
         <require
             permission="launchpad.View"
-            interface="lp.bugs.interfaces.structuralsubscription.IStructuralSubscriptionTargetRead" />
+            attributes="
+                bug_subscriptions
+                getSubscription
+                getSubscriptions
+                target_type_display
+                userCanAlterBugSubscription
+                userCanAlterSubscription
+                userHasBugSubscriptions"/>
         <require
             permission="launchpad.AnyAllowedPerson"
             interface="lp.bugs.interfaces.structuralsubscription.IStructuralSubscriptionTargetWrite" />
 
+        <!-- IBugTarget -->
+        <require
+             permission="launchpad.LimitedView"
+             attributes="
+                 bugtargetdisplayname"/>>
+        <require
+             permission="launchpad.View"
+             attributes="
+                 bug_reported_acknowledgement
+                 bug_reporting_guidelines
+                 bugtargetname
+                 createBug
+                 enable_bugfiling_duplicate_search
+                 getBugTaskWeightFunction
+                 pillar
+                 searchTasks"/>
+
     </class>
     <adapter
         provides="lp.bugs.interfaces.bugtracker.IHasExternalBugTracker"

=== modified file 'lib/lp/registry/interfaces/productseries.py'
--- lib/lp/registry/interfaces/productseries.py	2012-12-04 09:58:24 +0000
+++ lib/lp/registry/interfaces/productseries.py	2012-12-05 09:37:31 +0000
@@ -159,7 +159,7 @@
 
 
 class IProductSeriesView(
-    ISeriesMixin, IHasAppointedDriver, IHasOwner, IBugTarget,
+    ISeriesMixin, IHasAppointedDriver, IHasOwner,
     ISpecificationGoal, IHasMilestones, IHasOfficialBugTags, IHasExpirableBugs,
     IHasTranslationImports, IHasTranslationTemplates, IServiceUsage):
     status = exported(
@@ -341,7 +341,7 @@
 
 class IProductSeries(IProductSeriesEditRestricted, IProductSeriesPublic,
                      IProductSeriesView, IProductSeriesLimitedView,
-                     IStructuralSubscriptionTarget):
+                     IStructuralSubscriptionTarget, IBugTarget):
     """A series of releases. For example '2.0' or '1.3' or 'dev'."""
     export_as_webservice_entry('project_series')
 

=== modified file 'lib/lp/registry/tests/test_productseries.py'
--- lib/lp/registry/tests/test_productseries.py	2012-12-04 10:19:53 +0000
+++ lib/lp/registry/tests/test_productseries.py	2012-12-05 09:50:37 +0000
@@ -622,14 +622,16 @@
             'addSubscription', 'removeBugSubscription',
             )),
         'launchpad.Edit': set(('newMilestone', )),
-        'launchpad.LimitedView': set(('name', 'product', 'productID')),
+        'launchpad.LimitedView': set((
+            'bugtargetdisplayname', 'bugtarget_parent', 'name',
+            'parent_subscription_target', 'product', 'productID', 'series')),
         'launchpad.View': set((
             '_all_specifications', '_getOfficialTagClause',
             '_valid_specifications', 'active', 'all_milestones',
             'answers_usage', 'blueprints_usage', 'branch',
             'bug_reported_acknowledgement', 'bug_reporting_guidelines',
             'bug_subscriptions', 'bug_supervisor', 'bug_tracking_usage',
-            'bugtargetdisplayname', 'bugtarget_parent', 'bugtargetname',
+            'bugtargetname',
             'codehosting_usage', 'createBug', 'datecreated', 'displayname',
             'driver', 'drivers', 'enable_bugfiling_duplicate_search',
             'getAllowedSpecificationInformationTypes',
@@ -652,11 +654,10 @@
             'has_sharing_translation_templates', 'has_translation_files',
             'has_translation_templates', 'is_development_focus', 'milestones',
             'official_bug_tags', 'owner', 'packagings', 'parent',
-            'parent_subscription_target',
             'personHasDriverRights', 'pillar', 'potemplate_count',
             'productserieslanguages', 'release_files',
             'releasefileglob', 'releases', 'releaseverstyle', 'searchTasks',
-            'series', 'setPackaging', 'sourcepackages', 'specifications',
+            'setPackaging', 'sourcepackages', 'specifications',
             'status', 'summary', 'target_type_display', 'title',
             'translations_autoimport_mode', 'userCanAlterBugSubscription',
             'userCanAlterSubscription', 'userHasBugSubscriptions',


-- 
https://code.launchpad.net/~adeuring/launchpad/bug-1086057/+merge/138086
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References