Fix a bug with drafts in diff-context API

Review Request #1520 — Created Jan. 3, 2019 and submitted

guest5108
Review Board
guest5108, smith
If the submitter has a draft published and user b is given permission to view that
draft they are unable to view that draft via the diff-context using revisions and
interdiff-revisions.
i.e. api/review-requests/1515686/diff-context/?interdiff-revision=2&revision=1

Testing Done:
If User2 has a review_request {rr_id} and it has 1 published diff and 1 draft
diff and User1 has permission to view drafts then:

    curl --cookie "rbsessionid={cookie_user1}" "https://{rb-site}/api/review-requests/{rr_id}/draft/diffs/2/"
    curl --cookie "rbsessionid={cookie_user2}" "https://{rb-site}/api/review-requests/{rr_id}/draft/diffs/2/"

Both returns the diff, but:

    curl --cookie "rbsessionid={cookie_user1}" "https://{rb-site}/api/review-requests/{rr_id}/diff-context/?interdiff-revision=2&revision=1"
    curl --cookie "rbsessionid={cookie_user2}" "https://{rb-site}/api/review-requests/{rr_id}/diff-context/?interdiff-revision=2&revision=1"

Only returns the diff for User2 and returns

    {
      "stat": "fail",
      "err": {
        "msg": "Object does not exist",
        "code": 100
      }
    }

Reviewed at https://reviews.reviewboard.org/r/10363/


guest5108
guest5108
guest5108
guest5108
Review request changed

Status: Closed (submitted)

guest6774
  1. Ship It!
  2. 
      
Loading...