launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #21005
[Merge] lp:~wgrant/launchpad/bug-1083709-again into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/bug-1083709-again into lp:launchpad.
Commit message:
Let project drivers edit series and productreleases, as series drivers can. Project drivers should have series driver power over all series.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-1083709-again/+merge/306167
Let project drivers edit series and productreleases, as series drivers can. Project drivers should have series driver power over all series.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-1083709-again into lp:launchpad.
=== modified file 'lib/lp/registry/doc/productrelease.txt'
--- lib/lp/registry/doc/productrelease.txt 2012-04-10 14:01:17 +0000
+++ lib/lp/registry/doc/productrelease.txt 2016-09-20 00:39:35 +0000
@@ -20,9 +20,8 @@
>>> verifyObject(IProductRelease, firefox_109)
True
-The driver for the release's milestone target cannot change the release, but
-the driver of the milestone's series_target is a release manager and can
-make changes.
+A person appointed to the project or series driver role is a release
+manager and can make changes.
>>> from lp.services.webapp.authorization import check_permission
@@ -34,7 +33,7 @@
>>> ignored = login_person(driver)
>>> check_permission('launchpad.Edit', firefox_109)
- False
+ True
>>> ignored = login_person(release_manager)
>>> check_permission('launchpad.Edit', firefox_109)
=== modified file 'lib/lp/registry/doc/productseries.txt'
--- lib/lp/registry/doc/productseries.txt 2016-01-26 15:47:37 +0000
+++ lib/lp/registry/doc/productseries.txt 2016-09-20 00:39:35 +0000
@@ -110,20 +110,20 @@
= Drivers and release managers =
-A driver for an IProduct or IProjectGroup cannot modify a product series.
+A person appointed to the project or series driver role is a release
+manager and can edit a product series.
>>> from lp.services.webapp.authorization import check_permission
- >>> ignored = login_person(series_driver)
- >>> print emacs_series.owner.name
- name12
- >>> print emacs_series.driver
- None
+ >>> firefox_driver = factory.makePerson()
+ >>> ignored = login_person(firefox_driver)
>>> check_permission('launchpad.Edit', emacs_series)
False
-
-A person appointed to the series driver has the release manager role and can
-edit a product series.
+ >>> ignored = login_person(firefox.owner)
+ >>> firefox.driver = firefox_driver
+ >>> ignored = login_person(firefox_driver)
+ >>> check_permission('launchpad.Edit', emacs_series)
+ True
>>> ignored = login_person(firefox.owner)
>>> emacs_series.driver = series_driver
=== modified file 'lib/lp/security.py'
--- lib/lp/security.py 2016-08-23 08:05:44 +0000
+++ lib/lp/security.py 2016-09-20 00:39:35 +0000
@@ -1374,9 +1374,9 @@
usedfor = IProductSeries
def checkAuthenticated(self, user):
- """Allow product owner, some experts, or admins."""
- if (user.inTeam(self.obj.product.owner) or
- user.inTeam(self.obj.driver)):
+ """Allow product owner, drivers, some experts, or admins."""
+ if (user.isOwner(self.obj.product) or
+ user.isDriver(self.obj)):
# The user is the owner of the product, or the release manager.
return True
# Rosetta experts need to be able to upload translations.
@@ -1710,9 +1710,8 @@
usedfor = IProductRelease
def checkAuthenticated(self, user):
- if (user.inTeam(self.obj.productseries.owner) or
- user.inTeam(self.obj.productseries.product.owner) or
- user.inTeam(self.obj.productseries.driver)):
+ if (user.isOwner(self.obj.productseries.product) or
+ user.isDriver(self.obj.productseries)):
# The user is an owner or a release manager.
return True
return EditByOwnersOrAdmins.checkAuthenticated(
Follow ups