Page MenuHomePhabricator

D17124.id41181.diff
No OneTemporary

D17124.id41181.diff

diff --git a/src/applications/phid/query/PhabricatorObjectListQuery.php b/src/applications/phid/query/PhabricatorObjectListQuery.php
--- a/src/applications/phid/query/PhabricatorObjectListQuery.php
+++ b/src/applications/phid/query/PhabricatorObjectListQuery.php
@@ -149,7 +149,22 @@
$missing = array();
foreach ($name_map as $key => $name) {
if (empty($objects[$key])) {
- $missing[] = $name;
+ $missing[$key] = $name;
+ }
+ }
+
+ $result = array_unique(mpull($objects, 'getPHID'));
+
+ // For values which are plain PHIDs of allowed types, let them through
+ // unchecked. This can happen occur if subscribers or reviewers which the
+ // revision author does not have permission to see are added by Herald
+ // rules. Any actual edits will be checked later: users are not allowed
+ // to add new reviewers they can't see, but they can touch a field which
+ // contains them.
+ foreach ($missing as $key => $value) {
+ if (isset($allowed[phid_get_type($value)])) {
+ unset($missing[$key]);
+ $result[$key] = $value;
}
}
@@ -181,8 +196,6 @@
}
}
- $result = array_unique(mpull($objects, 'getPHID'));
-
if ($suffixes) {
foreach ($result as $key => $phid) {
$result[$key] = array(

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 12:30 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704513
Default Alt Text
D17124.id41181.diff (1 KB)

Event Timeline