Code review comment for lp:~jtv/launchpad/bug-457987

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

= Bug 457987 =

The main Translations page for a project invites logged-in users to
download or upload translations. It should do the latter only for users
who are actually allowed to upload translations to the project. (There
may also be users who are allowed to upload translations to specific
languages in the project's translations, but they can't do that at this
level. They need to drill down to the POFile they want to upload to.)
We were getting some oopses from people following the upload link when
they weren't authorized to access the target page.

So here's the fix. As you can see the conditional tag surrounding all
this was once meant to show the link only to users with admin rights for
the project, but has changed into a check for logged-in users somewhere
along the line. I turned it into a span with an id for easier testing.

No lint. Test with {{{./bin/test -vv -t xx-product-translations.txt}}}
but might as well run all Translations stories if you have the few extra
minutes it takes. I did.

To Q/A, pick or set up a project that uses Launchpad for translations
and has at least an approved template. Then access its main
translations page anonymously (no upload or download links); as an owner
or admin or translations admin (upload and download links); and as a
regular user (download link only).

If you need to set up a template but don't have the Translations admin
rights needed to approve its import, note that you can now set up a
branch on staging and have your project import templates from there.
Push a template into that branch and within the hour you'll have it
uploaded, approved, and possibly even imported.

Jeroen

« Back to merge proposal