@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make restricted objects in commit messages work more consistently with the web UI

Summary:
Fixes T11344. In the web UI, if a field like "Subscribers" on an object (like a task) contains values you don't have permission to see, you see tokens for them (like "Restricted Project") but not their names.

Make commit messages work the same way: you see the PHID, and can remove it or leave it there, but can't see the underlying name.

(We have to render an actual PHID rather than just "Restricted Thing" because we have to be able to figure out what edit the user is actually trying to make.)

Test Plan: Interacted with a revision via the CLI that had project reviewers I couldn't see.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11344

Differential Revision: https://secure.phabricator.com/D17124

+16 -3
+16 -3
src/applications/phid/query/PhabricatorObjectListQuery.php
··· 149 149 $missing = array(); 150 150 foreach ($name_map as $key => $name) { 151 151 if (empty($objects[$key])) { 152 - $missing[] = $name; 152 + $missing[$key] = $name; 153 + } 154 + } 155 + 156 + $result = array_unique(mpull($objects, 'getPHID')); 157 + 158 + // For values which are plain PHIDs of allowed types, let them through 159 + // unchecked. This can happen occur if subscribers or reviewers which the 160 + // revision author does not have permission to see are added by Herald 161 + // rules. Any actual edits will be checked later: users are not allowed 162 + // to add new reviewers they can't see, but they can touch a field which 163 + // contains them. 164 + foreach ($missing as $key => $value) { 165 + if (isset($allowed[phid_get_type($value)])) { 166 + unset($missing[$key]); 167 + $result[$key] = $value; 153 168 } 154 169 } 155 170 ··· 180 195 implode(', ', $missing))); 181 196 } 182 197 } 183 - 184 - $result = array_unique(mpull($objects, 'getPHID')); 185 198 186 199 if ($suffixes) { 187 200 foreach ($result as $key => $phid) {