launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #01533
[Merge] lp:~brian-murray/launchpad/bug-supervisor-guidelines-and-ack into lp:launchpad/devel
Brian Murray has proposed merging lp:~brian-murray/launchpad/bug-supervisor-guidelines-and-ack into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
This branch changes the permissions for editing a distribution source package from launchpad.Edit to launchpad.BugSupervisor. The effective part of this change was already made in https://code.edge.launchpad.net/~brian-murray/launchpad/bug-supervisor-permissions/+merge/37514. However, after that branch I made one that created launchpad.BugSupervisor, https://code.edge.launchpad.net/~brian-murray/launchpad/modify-official-bug-tags-permissions/+merge/37758, and to clarify the permissions it makes sense that they both reference launchpad.BugSupervisor.
I did modify the test "test_edit_permissions.py" as a part of this so it can be tested via:
bin/test -cvvt test_edit_permissions
--
https://code.launchpad.net/~brian-murray/launchpad/bug-supervisor-guidelines-and-ack/+merge/38468
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~brian-murray/launchpad/bug-supervisor-guidelines-and-ack into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/security.py'
--- lib/canonical/launchpad/security.py 2010-10-14 15:22:46 +0000
+++ lib/canonical/launchpad/security.py 2010-10-14 21:56:47 +0000
@@ -891,7 +891,7 @@
class EditDistributionSourcePackageByDistroOwnersOrAdmins(AuthorizationBase):
"""The owner of a distribution should be able to edit its source
package information"""
- permission = 'launchpad.Edit'
+ permission = 'launchpad.BugSupervisor'
usedfor = IDistributionSourcePackage
def checkAuthenticated(self, user):
=== modified file 'lib/lp/registry/browser/tests/test_edit_permissions.py'
--- lib/lp/registry/browser/tests/test_edit_permissions.py 2010-10-04 19:55:15 +0000
+++ lib/lp/registry/browser/tests/test_edit_permissions.py 2010-10-14 21:56:47 +0000
@@ -19,6 +19,10 @@
from canonical.launchpad.webapp.authorization import check_permission
from canonical.launchpad.webapp.servers import LaunchpadTestRequest
from canonical.testing.layers import DatabaseFunctionalLayer
+
+from lp.registry.interfaces.distributionsourcepackage import (
+ IDistributionSourcePackage)
+
from lp.registry.interfaces.person import IPersonSet
from lp.testing import TestCaseWithFactory
from lp.testing.views import create_initialized_view
@@ -58,7 +62,10 @@
admin = getUtility(IPersonSet).getByEmail('foo.bar@xxxxxxxxxxxxx')
login_person(admin)
view = create_initialized_view(self.target, '+edit')
- self.assertTrue(check_permission('launchpad.Edit', view))
+ if IDistributionSourcePackage.providedBy(self.target):
+ self.assertTrue(check_permission('launchpad.BugSupervisor', view))
+ else:
+ self.assertTrue(check_permission('launchpad.Edit', view))
def test_registry_expert_cannot_edit(self):
login_person(self.registry_admin)
@@ -114,7 +121,7 @@
def test_bug_supervisor_can_edit(self):
login_person(self.supervisor_member)
view = create_initialized_view(self.target, '+edit')
- self.assertTrue(check_permission('launchpad.Edit', view))
+ self.assertTrue(check_permission('launchpad.BugSupervisor', view))
def test_suite():
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2010-10-14 16:59:46 +0000
+++ lib/lp/registry/configure.zcml 2010-10-14 21:56:47 +0000
@@ -488,7 +488,7 @@
addAnswerContact
removeAnswerContact"/>
<require
- permission="launchpad.Edit"
+ permission="launchpad.BugSupervisor"
set_attributes="
bug_reported_acknowledgement
bug_reporting_guidelines"/>