Merge ~andrey-fedoseev/launchpad:archive-subscriptions-links into launchpad:master
Status: | Merged |
---|---|
Approved by: | Andrey Fedoseev |
Approved revision: | c4fbaa3203b2edd29741580a7997c004eb5753c5 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~andrey-fedoseev/launchpad:archive-subscriptions-links |
Merge into: | launchpad:master |
Diff against target: |
459 lines (+275/-40) 9 files modified
lib/lp/security.py (+9/-30) lib/lp/services/webapp/authorization.py (+4/-2) lib/lp/services/webapp/tests/test_authorization.py (+20/-4) lib/lp/soyuz/browser/archivesubscription.py (+23/-0) lib/lp/soyuz/interfaces/archive.py (+18/-0) lib/lp/soyuz/model/archive.py (+48/-0) lib/lp/soyuz/templates/person-archive-subscriptions.pt (+6/-2) lib/lp/soyuz/tests/test_archive.py (+138/-0) lib/lp/soyuz/tests/test_archive_subscriptions.py (+9/-2) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+423346@code.launchpad.net |
Commit message
Archive subscriptions: add links to PPAs
LP: #860268
Add `checkViewPermi
Update `ViewArchive` to use `ArchiveSet.
Add `result` argument to `precache_
Description of the change
I added links to PPAs on the Archive Subscriptions page
For that, I need to check `launchpad.View` permission for each of the archives on that page.
Check permission for each individual archive may be expensive since it needs to run a few database queries per-archive. As a workaround, I added a method the `ArchiveSet.
This is ready for review, but I am going to add some tests for `ArchiveSet.
Thanks for tackling this! This did indeed turn out to be a bit less trivial than I was expecting, but this is a very creditable first attempt and it should be great experience with Storm and with how authorization works in Launchpad. Let me know if you have any questions about these comments, since some of them are quite complex.