Merge lp:~wgrant/launchpad/bug-592935-hide-disabled-ppas into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Māris Fogels
Approved revision: no longer in the source branch.
Merged at revision: 11017
Proposed branch: lp:~wgrant/launchpad/bug-592935-hide-disabled-ppas
Merge into: lp:launchpad
Diff against target: 72 lines (+20/-24)
2 files modified
lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt (+18/-20)
lib/lp/soyuz/templates/person-ppas.pt (+2/-4)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-592935-hide-disabled-ppas
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Review via email: mp+27411@code.launchpad.net

Commit message

Hide non-Viewable PPAs from the person index. This prevents normal users from seeing others' disabled PPAs

Description of the change

Normal users are currently able to see the disabled and deleted PPAs of others on their index pages (eg. https://launchpad.net/~wgrant, the two or three stricken-out ones).

This is pointless, confusing, makes deletion look like a joke, and generally annoys users. As far as I can tell it is unintentional, as others I've talked to weren't aware that it was the case.

The fix is simple: just check for launchpad.View on the PPA, since that's revoked from non-owners when a PPA is disabled or deleted. This also has the side-effect of removing an empty <tr> which was in the place of invisible private PPAs.

To post a comment you must log in.
Revision history for this message
Māris Fogels (mars) wrote :

Hi William,

A huge +1 from me for fixing this. You are right, the previous behaviour was bad. A nice, small, clean fix.

I'll assume you will run the full suite before landing this. You never know what other tests may unintentionally depend on the PPA link listing.

r=mars

Maris

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2010-05-09 21:11:52 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2010-06-12 05:20:44 +0000
@@ -644,33 +644,31 @@
644 >>> admin_browser.getControl(name="field.enabled").value = False644 >>> admin_browser.getControl(name="field.enabled").value = False
645 >>> admin_browser.getControl("Save").click()645 >>> admin_browser.getControl("Save").click()
646646
647Anonymous access or users with no permission to view Celso's 'edge'647Anonymous users or others with no special permissions on the disabled PPA
648ppa can see it listed in Celso's profile page.648are unable to see it on Celso's profile page.
649649
650 >>> anon_browser.open("http://launchpad.dev/~cprov")650 >>> anon_browser.open("http://launchpad.dev/~cprov")
651 >>> print_tag_with_id(anon_browser.contents, 'ppas')
652 Personal package archives
653 PPA for Celso Providelo
654
651 >>> browser.open("http://launchpad.dev/~cprov")655 >>> browser.open("http://launchpad.dev/~cprov")
652
653 >>> print_tag_with_id(anon_browser.contents, 'ppas')
654 Personal package archives
655 Edge PPA
656 PPA for Celso Providelo
657
658 >>> print_tag_with_id(browser.contents, 'ppas')656 >>> print_tag_with_id(browser.contents, 'ppas')
659 Personal package archives657 Personal package archives
658 PPA for Celso Providelo
659
660Celso himself can see the PPA, and it's linked so he can reenable it if
661required.
662
663 >>> cprov_browser.open("http://launchpad.dev/~cprov")
664 >>> print_tag_with_id(cprov_browser.contents, 'ppas')
665 Personal package archives
660 Edge PPA666 Edge PPA
661 PPA for Celso Providelo667 PPA for Celso Providelo
662668 Create a new PPA
663However the reference to Celso's 'Edge PPA' is not linked.669
664670 >>> print cprov_browser.getLink('Edge PPA')
665 >>> print anon_browser.getLink('Edge PPA')671 <Link ...>
666 Traceback (most recent call last):
667 ...
668 LinkNotFoundError
669
670 >>> print browser.getLink('Edge PPA')
671 Traceback (most recent call last):
672 ...
673 LinkNotFoundError
674672
675And direct access to the PPA page is also denied.673And direct access to the PPA page is also denied.
676674
677675
=== modified file 'lib/lp/soyuz/templates/person-ppas.pt'
--- lib/lp/soyuz/templates/person-ppas.pt 2009-08-21 13:48:43 +0000
+++ lib/lp/soyuz/templates/person-ppas.pt 2010-06-12 05:20:44 +0000
@@ -6,10 +6,8 @@
6 <div tal:define="ppas context/ppas" tal:condition="ppas">6 <div tal:define="ppas context/ppas" tal:condition="ppas">
7 <table>7 <table>
8 <tal:ppa_line tal:repeat="ppa ppas">8 <tal:ppa_line tal:repeat="ppa ppas">
9 <tr>9 <tr tal:condition="ppa/required:launchpad.View">
10 <td tal:define="ppa_link ppa/fmt:link"10 <td tal:content="structure ppa/fmt:link"></td>
11 tal:condition="ppa_link"
12 tal:content="structure ppa_link"></td>
13 </tr>11 </tr>
14 </tal:ppa_line>12 </tal:ppa_line>
15 </table>13 </table>