Fix issues with deleting comments on replies.

Review Request #4138 — Created May 11, 2013 and submitted — Latest diff uploaded

Information

Review Board
release-1.7.x

Reviewers

Fix issues with deleting comments on replies.

We've had some long-standing issues deleting comments on replies.
Deleting comments using the reviews/<id>/replies</id>/*-comments/ URLs
was supposed to work, but we didn't have any tests covering this and
never noticed we didn't have proper has_delete_permissions functions for
these resources.

The has_delete_permissions functions for comment classe have moved from
the subclasses into the base classes. This will ensure that any subclass
that enables deletion will do the right thing.

While writing tests for this, I also found that our diff comment
querying behaved differently from screenshots and file attachments. They
were only accessible for public comments or when the requester owned
them. This was unnecessary, and we really wanted to return Forbidden in
this case. Diff comments have been updated in this case to match what
the other comments do.
All unit tests (including the 12 new ones) pass.

I also verified this with my ReviewBoxView change for 1.8.
    Loading...