← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~henninge/launchpad/devel-487137-custom-language-codes into lp:launchpad

 

Henning Eggers has proposed merging lp:~henninge/launchpad/devel-487137-custom-language-codes into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #487137 Allow Rosetta admins to create custom language codes
  https://bugs.launchpad.net/bugs/487137


= Summary =

This branch finishes off Adi's branch for the same bug which had
already been approved but was never landed. See the details here:
https://code.launchpad.net/~adiroiban/launchpad/bug-487137/+merge/23901

Also, the scope changed slightly because management of custom
language codes has now been extendended  to project owners and
distribution translation teams respectively, so they can manage these
themselves. Great way to reduce the work load on admins and Launchapd
devs. ;-)

== Proposed fix ==

Remove AdminCustomLanguageCodes from security.py. This was the main
bug (and a good reason for not landing Adi's branch) as it shadowed
AdminProductTranslations and thus took this privilege away from
product owners. AdminProductTranslations is exactly what we need now
to allow access to owners & Rosetta admins.

Add AdminDistributionSourcePackageTranslations to grant
launchpad.TranslationsAdmin privileges on a DistributionSourcePackage
to the same persons that have it on the distribution.

Fix AdminCustomLanguageCode to allow access for owners and
distribution translation teams.

Update the page test to show the new behavior.

== Pre-implementation notes ==

I read through the previous mp and saw that it was well done. I did
some experiementing to figure out what was wrong with the branch and
found out about the shadowing issue. I talked to Danilo and we
decided to extendend privileges to project owners.

== Implementation details ==

AdminProductTranslations and AdminDistributionTranslations already do
the right thing and are used by the new adapters.
A custom language code can either be linked to a Product or a

DistributionSourcepackage (combination of distribution and
sourcepacakgename), so that the security adapter has to select the
right adapter to forward to.

AdminCustomLanguageCode already implemented forwarding via the
"distribution" attribute, so it could be used, too.

The test was re-written to use the owner_browser for all actions on a
Product. For the DistributionSourcePackage a translation group needed
to be added because its owner will have translation admin privileges
within the distribution. A new translations_browser was added for
this person.

== Tests ==

bin/test -vvcm lp.translations -t custom-language-codes.txt

== Demo and Q/A ==

On launchpad.dev login as test@xxxxxxxxxxxxx (name12) and go to this
page: https://translations.launchpad.dev/evolution
You should see the "define custom language codes" link.
Click on it and play around with the admin interface.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/translations/templates/sourcepackage-translations.pt
  lib/lp/translations/templates/customlanguagecode-remove.pt
  lib/lp/translations/browser/configure.zcml
  lib/lp/translations/browser/customlanguagecode.py
  lib/canonical/launchpad/security.py
  lib/lp/translations/templates/customlanguagecodes-index.pt
  lib/lp/translations/templates/customlanguagecode-index.pt
  lib/lp/translations/stories/standalone/custom-language-codes.txt
  lib/lp/translations/templates/product-portlet-translatables.pt
-- 
https://code.launchpad.net/~henninge/launchpad/devel-487137-custom-language-codes/+merge/44446
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~henninge/launchpad/devel-487137-custom-language-codes into lp:launchpad.



Follow ups