Code review comment for lp:~henninge/launchpad/bug-515680-status

Revision history for this message
Henning Eggers (henninge) wrote :

= Bug 515680 =

The goal of this branch is to restrict access to the BLOCKED status to project owners and drivers (and admins, of course). The uploader should not be able to set their entry to BLOCKED.

== Proposed fix ==

Update TranslationImportQueueEntry.canSetStatus to disallow importers to set BLOCKED which it currently allows.

== Implementation details ==

I used this oportunity to update some very specific "is*" methods to be called "canEdit" and "canAdmin" and behave accordingly. This also changed their use in security.py.

== Test ==

./bin/test -vvct TestCanSetStatus

== Demo/QA ==

As the member of a translation team but not the owner or driver of the project, upload a file to a project. Go to them import queue and check that "Blocked" is not available to you. Go there as the maintainer or driver of the project and you can set it.

As a corner case, upload a file as the maintainer, Blocked should still be available.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/launchpad/security.py
  lib/lp/translations/interfaces/translationimportqueue.py
  lib/lp/translations/model/translationimportqueue.py
  lib/lp/translations/tests/test_translationimportqueue.py

== Pylint notices ==

lib/lp/translations/interfaces/translationimportqueue.py
    10: [F0401] Unable to import 'lazr.enum' (No module named enum)
    20: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)
    21: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
    22: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)

« Back to merge proposal