Expose IPerson.inTeam via launchpad REST API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Unassigned |
Bug Description
I am writing some code to do simple checking of whether a person is a member (either directly or indirectly of a team). In my particular use case, I use a restricted team to keep track of people who have signed a contributor license agreement for the project, and I want to make lp:tarmac only merge branches from people who are a member of that team.
Currently I have this code snippet:
person = launchpad.
contributor_team = launchpad.
authorized_
for p in contributor_
authorized_
if person.name in authorized_
status = 'APPROVED CONTRIBUTOR'
else:
status = 'CONTRIBUTOR AGREEMENT NOT YET RECEIVED'
However, looking at the launchpad API documentation, I see a note on team.participan
if person.
Could you expose this method through the web API? Talking to sinzui today he thought it might be one line of code to add this.
affects: | launchpad → launchpad-registry |
Changed in launchpad-registry: | |
status: | New → Triaged |
Changed in launchpad-registry: | |
assignee: | nobody → Curtis Hovey (sinzui) |
importance: | Undecided → High |
milestone: | none → 2.2.5 |
Changed in launchpad-registry: | |
milestone: | 2.2.5 → 2.2.6 |
Changed in launchpad-registry: | |
status: | Triaged → In Progress |
Changed in launchpad-registry: | |
assignee: | Curtis Hovey (sinzui) → nobody |
tags: | added: api teams |
tags: | added: disclosure |
summary: |
- please expose IPerson.inTeam via launchpad REST API + Expose IPerson.inTeam via launchpad REST API |
tags: | added: hardening |
tags: | removed: disclosure hardening |
I must abandon this. IPerson.inTeam is a privileged method and making work for external API is very difficult.
I recommend anyone working on this in the future to review the rejected work first: /code.edge. launchpad. net/~sinzui/ launchpad/ in-team/ +merge/ 6894
https:/
I propose that instead of exposing inTeam, a new API-safe method be added (isInTeam()). The method could use the is_visible_by_user construct as a guard that calls the real inTeam() method.