Merge lp:~jml/launchpad/create-private-ppa-814567 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13545 |
Proposed branch: | lp:~jml/launchpad/create-private-ppa-814567 |
Merge into: | lp:launchpad |
Diff against target: |
173 lines (+80/-8) 6 files modified
lib/lp/registry/interfaces/person.py (+6/-2) lib/lp/registry/model/person.py (+4/-4) lib/lp/soyuz/configure.zcml (+6/-0) lib/lp/soyuz/model/archive.py (+11/-1) lib/lp/soyuz/stories/webservice/xx-person-createppa.txt (+28/-0) lib/lp/soyuz/tests/test_archive.py (+25/-1) |
To merge this branch: | bzr merge lp:~jml/launchpad/create-private-ppa-814567 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+69539@code.launchpad.net |
Commit message
[r=julian-edwards][bug=814567] Add an API to create private PPAs, rather than changing privacy status post creation.
Description of the change
This branch makes it possible to create private PPAs over the webservice.
I couldn't find a good way to do the check on creation. Currently the ability to change privacy is controlled by a Zope attribute security check. I don't know how that works wrt object creation, and I *certainly* don't know how that works given that Archive.private is a property with side effects.
Thus, I duplicated the check that takes place in the security permission.
I also couldn't find a good set of tests that I could repurpose to make sure that setting .private and specifying private=True behaved the same.
Note that setting .private over the API raises 401 Unauthorized, but specifying private to createPPA raises 400 Bad Request.
<bigjools> jml: in your branch did you consider refactoring the check for commercial admin, somehow?
<bigjools> I'm not sure how I'd do it tbh :(
<jml> bigjools: the only thing that came to mind was writing a version of check_permission that took user as a parameter, rather than getting it from the session.
<bigjools> jml: I'm just wary of duplicating the check, that's all. Been there, picked up the pieces :(
<jml> bigjools: yeah. I can put a note in the new code & the zcml if you'd like, pointing one to the other.
<bigjools> jml: fair enough, thanks