Merge lp://staging/~sinzui/launchpad/delete-private-0 into lp://staging/launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Eleanor Berger
Approved revision: no longer in the source branch.
Merged at revision: 10885
Proposed branch: lp://staging/~sinzui/launchpad/delete-private-0
Merge into: lp://staging/launchpad
Diff against target: 170 lines (+68/-8)
6 files modified
lib/lp/registry/browser/__init__.py (+2/-2)
lib/lp/registry/browser/product.py (+1/-1)
lib/lp/registry/browser/tests/milestone-views.txt (+23/-0)
lib/lp/registry/browser/tests/peoplemerge-views.txt (+31/-0)
lib/lp/registry/doc/vocabularies.txt (+6/-2)
lib/lp/registry/vocabularies.py (+5/-3)
To merge this branch: bzr merge lp://staging/~sinzui/launchpad/delete-private-0
Reviewer Review Type Date Requested Status
Eleanor Berger (community) Approve
Review via email: mp+25340@code.staging.launchpad.net

Description of the change

This is my branch to allow users to delete regardless of privacy.

    lp:~sinzui/launchpad/delete-private-0
    Diff size: 120
    Launchpad bug: https://bugs.launchpad.net/bugs/556131
                   https://bugs.launchpad.net/bugs/462036
    Test command: ./bin/test -vv \
        -t milestone-views -t peoplemerge-views
    Pre-implementation: no one
    Target release: 10.05

Allow users to delete regardless of privacy
-------------------------------------------

Bug 556131 [deleting a private-membership team via the delete button, doesn't]
    The bug reported the issue was about a private team, but the test I wrote
    always passed. The *real* examples are about PRIVATE_MEMBERSHIP teams,
    which we supported last year.

Bug 462036 [Delete milestone will fail if private bugs are targeted]
    The RegistryDeleteViewMixin._getBugtasks() could use the principal of the
    current interaction, but that will not prevent this error from occurring
    if the owner or release manager does not have permission to see the bug.
    The correct fix must retrieve all bugtasks regardless of privacy. Private
    bugs that the user can see should be shown in the list. Those that cannot
    be seen will be silently untargeted. This implies that the untarget
    operation needs special access to get the list of bugtasks and need to use
    removeSecurityProxy to untarget the milestones. The user does not need to
    know that this happened.

Rules
-----

Bug 556131 [deleting a private-membership team via the delete button, doesn't]
    * Add PRIVATE_MEMBERSHIP to the ValidTeam vocab when the user is admin.

Bug 462036 [Delete milestone will fail if private bugs are targeted]
    * Pass the user in the bug params so that private bugs he can access are
      are untargeted. The user did have access to the bug in every oops; he
      had to manually untarget the private bugs before deleting the milestone.
    * It is possible that a driver will target a private bug that the
      owner/release manager cannot access. It is not possible to get all
      private bugs because there is not system user we can use as a proxy
      for the user doing the delete. We can re-examine this issue when ACLs
      are re-implemented.

QA
--

Bug 556131 [deleting a private-membership team via the delete button, doesn't]
    * As an admin, delete the teams in:
      https://answers.edge.launchpad.net/launchpad-registry/+question/106563

Bug 462036 [Delete milestone will fail if private bugs are targeted]
    * Create milestone and target a private and a public bug to it.
    * Choose the Delete link.
    * Verify the private bug is listed with the public bug.
    * Delete the milestone.
    * Verify you see the series page (not an oops)
    * Visit the private bug.
    * Verify that it is untargeted.

Lint
----
Linting changed files:
  lib/lp/registry/vocabularies.py
  lib/lp/registry/browser/__init__.py
  lib/lp/registry/browser/tests/milestone-views.txt
  lib/lp/registry/browser/tests/peoplemerge-views.txt

Test
----

    * lib/lp/registry/browser/tests/milestone-views.txt
      Added a test to verify that private bugs the user has access to are
      listed and deleted
    * lib/lp/registry/browser/tests/peoplemerge-views.txt
      Added a test to verify that PRIVATE_MEMBERSHIP teams can be deleted.

Implementation
--------------
    * lib/lp/registry/vocabularies.py
      In the case where the user is an admin, include PRIVATE_MEMBERSHIP teams
      in the ValidTeam vocabulary.
    * lib/lp/registry/browser/__init__.py
      Pass the user in the bugtask search so that private bug he has access to
      will be included.

To post a comment you must log in.
Revision history for this message
Eleanor Berger (intellectronica) wrote :

Looks good. There were a couple of typos and grammar errors in one of the doctest paragraphs and below is a corrected version you can use:

Milestones with private bugs can be deleted. There is one caveate, the person deleting the milestone must have permssion to access the bug for it to be untargeted. It is possible for the owner or release manager to not have access to a private bug that was targeted to a milestone by a driver.

Revision history for this message
Eleanor Berger (intellectronica) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.