Merge lp://staging/~sinzui/launchpad/person-owned-teams into lp://staging/launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Curtis Hovey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 16363 | ||||
Proposed branch: | lp://staging/~sinzui/launchpad/person-owned-teams | ||||
Merge into: | lp://staging/launchpad | ||||
Diff against target: |
394 lines (+216/-5) 10 files modified
lib/lp/registry/browser/configure.zcml (+6/-0) lib/lp/registry/browser/person.py (+20/-1) lib/lp/registry/browser/tests/test_person.py (+43/-0) lib/lp/registry/interfaces/person.py (+13/-1) lib/lp/registry/model/person.py (+12/-0) lib/lp/registry/templates/person-owned-teams.pt (+70/-0) lib/lp/registry/templates/person-related-software-navlinks.pt (+4/-0) lib/lp/registry/templates/product-portlet-requires-subscription.pt (+3/-3) lib/lp/registry/tests/test_person.py (+44/-0) lib/lp/soyuz/stories/soyuz/xx-person-packages.txt (+1/-0) |
||||
To merge this branch: | bzr merge lp://staging/~sinzui/launchpad/person-owned-teams | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benji York (community) | code | Approve | |
Review via email: mp+139091@code.staging.launchpad.net |
Commit message
List teams a person owns.
Description of the change
Team owners are not necessarily team members. All code that lists teams
for people are based on membership. There is no way to discover which
teams a person owns. This is a problem for cases where a person leaves
an organisation -- the team owner does not show up when auditing,
and owners can add themselves back to the team to gain team privileges.
RULES
Pre-
* Add a method to IPerson to get the teams a person owns. The
method must take a user argument to filter out private teams the
observing user cannot see.
* Add a related teams page to the related packages/projects group
of pages. The page must batch the teams.
QA
* Visit https:/
* Verify there is a link to owned teams.
* View the link's page.
* Verify the page lists the teams.
* Run this script:
{{{
from launchpadlib.
lp = Launchpad.
'testing', service_root='https:/
person = lp.people['sinzui']
teams = person.
for team in teams:
print team.name
lp = Launchpad.
'testing', service_root='https:/
person = lp.people['sinzui']
teams = person.
for team in teams:
print team.name
}}}
LINT
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
LoC
I have more than 10,000 lines of credit this week.
TEST
./bin/test -vc -t OwnedTeams lp.registry
IMPLEMENTATION
I added getOwnedTeams to IPerson that return the teams for a Person that
a user is permitted to see. I exported it to use the requesting user as
the user passed to the method.
lib/
lib/
lib/
I added PersonOwnedTeam
then added a link to the IPersonRelatedS
integration.
lib/
lib/
lib/
lib/
lib/
This branch looks good. I had two small observations:
A tad more commentary in PersonOwnedTeam sViewTestCase would be good.
It looks like line 267 of the diff should be dedented two spaces.