This branch looks good. I have a few comments below for changes I would like.
-Edwin
>=== modified file 'lib/canonical/launchpad/security.py'
>--- lib/canonical/launchpad/security.py 2010-09-14 18:28:53 +0000
>+++ lib/canonical/launchpad/security.py 2010-10-06 17:27:19 +0000
>@@ -61,6 +61,7 @@
> IBuildFarmJobOld,
> )
> from lp.buildmaster.interfaces.packagebuild import IPackageBuild
>+from lp.bugs.interfaces.bugtarget import IOfficialBugTagTargetRestricted
> from lp.code.interfaces.branch import (
> IBranch,
> user_has_special_branch_access,
>@@ -656,7 +657,7 @@
>
> def checkAuthenticated(self, user):
> """Only the Launchpad admins need this, we are only going to use it
>- for connecting up series and distroseriess where we did not have
>+ for connecting up series and distroseries where we did not have
> them."""
According to PEP8, if the docstring is more than one line, the
ending triple-quotes should appear on a line by itself.
This line is too long. It can be wrapped like
AdminDistroSeriesLanguagePacks.
>+ """The owner of a product and its bug supervisor should be able to
>+ edit its official bug tags."""
The first sentence of the docstring should fit on a single line, and
there should be a blank line separating it from any additional text.
>+ permission = 'launchpad.BugSupervisor'
>+ usedfor = IOfficialBugTagTargetRestricted
>+
>+ def checkAuthenticated(self, user):
>+ return (user.inTeam(self.obj.bug_supervisor) or
>+ user.inTeam(self.obj.owner) or
>+ user.in_admin)
>+
>+
> class AdminDistroSeries(AdminByAdminsTeam):
> """Soyuz involves huge chunks of data in the archive and librarian,
> so for the moment we are locking down admin and edit on distributions
>=== modified file 'lib/lp/bugs/stories/bug-tags/xx-official-bug-tags.txt'
>--- lib/lp/bugs/stories/bug-tags/xx-official-bug-tags.txt 2010-10-03 15:30:06 +0000
>+++ lib/lp/bugs/stories/bug-tags/xx-official-bug-tags.txt 2010-10-06 17:27:19 +0000
>@@ -52,13 +52,32 @@
> ...
> Unauthorized...
>
>+The link is also available for the bug supervisor.
>+
>+ >>> from lp.testing.sampledata import ADMIN_EMAIL
>+ >>> from canonical.launchpad.ftests import login, logout
>+ >>> login(ADMIN_EMAIL)
>+ >>> d_owner = factory.makePerson()
>+ >>> logout()
>+ >>> login_person(d_owner)
>+ >>> distro = factory.makeDistribution(name='youbuntu', owner=d_owner)
>+ >>> supervisor_team = factory.makeTeam(owner=d_owner)
>+ >>> supervisor_member = factory.makePerson(password='g00dpassword')
>+ >>> added = supervisor_team.addMember(supervisor_member, d_owner)
>+ >>> distro.setBugSupervisor(supervisor_team, d_owner)
>+ >>> bug_super_browser = setupBrowser(
>+ ... auth='Basic %s:g00dpassword' %
>+ ... supervisor_member.preferredemail.email)
>+ >>> logout()
>+ >>> bug_super_browser.open(
>+ ... 'http://bugs.launchpad.dev/youbuntu/+manage-official-tags')
You're missing a test to see if the "Edit official tags" link
appears on the http://bugs.launchpad.dev/firefox page. Instead of
opening +manage-official-tags, you can click the link and check where
bug_super_browser.url ends up.
> == Official Tags on Bug Pages ==
>
> Official tags are displayed using a different style from unofficial ones.
> They are grouped together at the beginning of the list.
>
>- >>> from canonical.launchpad.ftests import login, logout
> >>> from canonical.launchpad.webapp import canonical_url
> >>> from lp.bugs.tests.bug import print_bug_tag_anchors
> >>> import transaction
>
>=== modified file 'lib/lp/registry/configure.zcml'
>--- lib/lp/registry/configure.zcml 2010-10-04 20:46:55 +0000
>+++ lib/lp/registry/configure.zcml 2010-10-06 17:27:19 +0000
>@@ -1143,13 +1145,15 @@
> freshmeatproject homepage_content
> homepageurl icon license_info licenses
> logo mugshot official_answers
>- official_blueprints official_bug_tags
>- official_codehosting official_malone owner
>- programminglang project
>- redeemSubscriptionVoucher releaseroot
>- remote_product screenshotsurl
>- security_contact sourceforgeproject
>- summary title wikiurl"/>
>+ official_blueprints official_codehosting
>+ official_malone owner programminglang
>+ project redeemSubscriptionVoucher
>+ releaseroot remote_product screenshotsurl
>+ security_contact sourceforgeproject summary
>+ title wikiurl"/>
This list is a pain to read. Can you put each item on a line by
itself and sort it?
>+ <require
>+ permission="launchpad.BugSupervisor"
>+ set_attributes="official_bug_tags"/>
>
> <!-- mark 2006-04-10 I put "name" in the admin group because
> with Bazaar now in place, lots of people can have personal
Hi Brian,
This branch looks good. I have a few comments below for changes I would like.
-Edwin
>=== modified file 'lib/canonical/ launchpad/ security. py' launchpad/ security. py 2010-09-14 18:28:53 +0000 launchpad/ security. py 2010-10-06 17:27:19 +0000 interfaces. packagebuild import IPackageBuild interfaces. bugtarget import IOfficialBugTag TargetRestricte d interfaces. branch import ( special_ branch_ access, ted(self, user):
>--- lib/canonical/
>+++ lib/canonical/
>@@ -61,6 +61,7 @@
> IBuildFarmJobOld,
> )
> from lp.buildmaster.
>+from lp.bugs.
> from lp.code.
> IBranch,
> user_has_
>@@ -656,7 +657,7 @@
>
> def checkAuthentica
> """Only the Launchpad admins need this, we are only going to use it
>- for connecting up series and distroseriess where we did not have
>+ for connecting up series and distroseries where we did not have
> them."""
According to PEP8, if the docstring is more than one line, the
ending triple-quotes should appear on a line by itself.
> return user.in_admin cialBugTagsByOw nerBugSuperviso rOrAdmins( AuthorizationBa se):
>
>@@ -897,6 +898,18 @@
> user.in_admin)
>
>
>+class EditProductOffi
This line is too long. It can be wrapped like esLanguagePacks .
AdminDistroSeri
>+ """The owner of a product and its bug supervisor should be able to
>+ edit its official bug tags."""
The first sentence of the docstring should fit on a single line, and
there should be a blank line separating it from any additional text.
>+ permission = 'launchpad. BugSupervisor' TargetRestricte d ted(self, user): self.obj. bug_supervisor) or self.obj. owner) or es(AdminByAdmin sTeam): bugs/stories/ bug-tags/ xx-official- bug-tags. txt' bugs/stories/ bug-tags/ xx-official- bug-tags. txt 2010-10-03 15:30:06 +0000 bugs/stories/ bug-tags/ xx-official- bug-tags. txt 2010-10-06 17:27:19 +0000 sampledata import ADMIN_EMAIL launchpad. ftests import login, logout makePerson( ) d_owner) makeDistributio n(name= 'youbuntu' , owner=d_owner) makeTeam( owner=d_ owner) makePerson( password= 'g00dpassword' ) team.addMember( supervisor_ member, d_owner) setBugSuperviso r(supervisor_ team, d_owner) member. preferredemail. email) browser. open( bugs.launchpad. dev/youbuntu/ +manage- official- tags')
>+ usedfor = IOfficialBugTag
>+
>+ def checkAuthentica
>+ return (user.inTeam(
>+ user.inTeam(
>+ user.in_admin)
>+
>+
> class AdminDistroSeri
> """Soyuz involves huge chunks of data in the archive and librarian,
> so for the moment we are locking down admin and edit on distributions
>=== modified file 'lib/lp/
>--- lib/lp/
>+++ lib/lp/
>@@ -52,13 +52,32 @@
> ...
> Unauthorized...
>
>+The link is also available for the bug supervisor.
>+
>+ >>> from lp.testing.
>+ >>> from canonical.
>+ >>> login(ADMIN_EMAIL)
>+ >>> d_owner = factory.
>+ >>> logout()
>+ >>> login_person(
>+ >>> distro = factory.
>+ >>> supervisor_team = factory.
>+ >>> supervisor_member = factory.
>+ >>> added = supervisor_
>+ >>> distro.
>+ >>> bug_super_browser = setupBrowser(
>+ ... auth='Basic %s:g00dpassword' %
>+ ... supervisor_
>+ >>> logout()
>+ >>> bug_super_
>+ ... 'http://
You're missing a test to see if the "Edit official tags" link bugs.launchpad. dev/firefox page. Instead of official- tags, you can click the link and check where browser. url ends up.
appears on the http://
opening +manage-
bug_super_
> == Official Tags on Bug Pages == launchpad. ftests import login, logout launchpad. webapp import canonical_url tag_anchors registry/ configure. zcml' registry/ configure. zcml 2010-10-04 20:46:55 +0000 registry/ configure. zcml 2010-10-06 17:27:19 +0000 codehosting official_malone owner ionVoucher releaseroot codehosting ionVoucher
>
> Official tags are displayed using a different style from unofficial ones.
> They are grouped together at the beginning of the list.
>
>- >>> from canonical.
> >>> from canonical.
> >>> from lp.bugs.tests.bug import print_bug_
> >>> import transaction
>
>=== modified file 'lib/lp/
>--- lib/lp/
>+++ lib/lp/
>@@ -1143,13 +1145,15 @@
> freshmeatproject homepage_content
> homepageurl icon license_info licenses
> logo mugshot official_answers
>- official_blueprints official_bug_tags
>- official_
>- programminglang project
>- redeemSubscript
>- remote_product screenshotsurl
>- security_contact sourceforgeproject
>- summary title wikiurl"/>
>+ official_blueprints official_
>+ official_malone owner programminglang
>+ project redeemSubscript
>+ releaseroot remote_product screenshotsurl
>+ security_contact sourceforgeproject summary
>+ title wikiurl"/>
This list is a pain to read. Can you put each item on a line by
itself and sort it?
>+ <require "launchpad. BugSupervisor" "official_ bug_tags" />
>+ permission=
>+ set_attributes=
>
> <!-- mark 2006-04-10 I put "name" in the admin group because
> with Bazaar now in place, lots of people can have personal