From 638cdb8d5773e7e9233911b02c6658bb709264bc Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 2 Apr 2015 07:27:53 -0700 Subject: [PATCH] Don't show comment draft state to non-object-owners Summary: Fixes T7720. We currently leak the "draft" state of checkboxes; never treat checkboxes as drafts if you can't mark them. Test Plan: Checked a box, reloaded page in other browser. Previously, the draft state partially propagated. Now, it no longer does. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T7720 Differential Revision: https://secure.phabricator.com/D12262 --- .../diff/view/PHUIDiffInlineCommentDetailView.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php index 679523c0b0..6bb57b9779 100644 --- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php +++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php @@ -252,6 +252,12 @@ final class PHUIDiffInlineCommentDetailView break; } + // If you don't have permission to mark the comment as "Done", you also + // can not see the draft state. + if (!$this->getCanMarkDone()) { + $draft_state = false; + } + if ($is_done) { $classes[] = 'inline-is-done'; }