Page MenuHomePhabricator

D16087.diff
No OneTemporary

D16087.diff

diff --git a/src/applications/pholio/query/PholioImageQuery.php b/src/applications/pholio/query/PholioImageQuery.php
--- a/src/applications/pholio/query/PholioImageQuery.php
+++ b/src/applications/pholio/query/PholioImageQuery.php
@@ -137,9 +137,12 @@
$all_files = mpull($all_files, null, 'getPHID');
if ($this->needInlineComments) {
- $all_inline_comments = id(new PholioTransactionComment())
- ->loadAllWhere('imageid IN (%Ld)',
- mpull($images, 'getID'));
+ // Only load inline comments the viewer has permission to see.
+ $all_inline_comments = id(new PholioTransactionComment())->loadAllWhere(
+ 'imageID IN (%Ld)
+ AND (transactionPHID IS NOT NULL OR authorPHID = %s)',
+ mpull($images, 'getID'),
+ $this->getViewer()->getPHID());
$all_inline_comments = mgroup($all_inline_comments, 'getImageID');
}

File Metadata

Mime Type
text/plain
Expires
Oct 15 2024, 7:28 PM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714071
Default Alt Text
D16087.diff (894 B)

Event Timeline