mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
Fix watcher query to work correctly with no watchers.
This commit is contained in:
parent
5f33aa5b4f
commit
16a2876448
1 changed files with 16 additions and 15 deletions
|
@ -1922,22 +1922,23 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
$query->execute();
|
||||
|
||||
$watcher_phids = $query->getDestinationPHIDs();
|
||||
if ($watcher_phids) {
|
||||
// We need to do a visibility check for all the watchers, as
|
||||
// watching a project is not a guarantee that you can see objects
|
||||
// associated with it.
|
||||
$users = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($this->requireActor())
|
||||
->withPHIDs($watcher_phids)
|
||||
->execute();
|
||||
|
||||
// We need to do a visibility check for all the watchers, as
|
||||
// watching a project is not a guarantee that you can see objects
|
||||
// associated with it.
|
||||
$users = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($this->requireActor())
|
||||
->withPHIDs($watcher_phids)
|
||||
->execute();
|
||||
|
||||
foreach ($users as $user) {
|
||||
$can_see = PhabricatorPolicyFilter::hasCapability(
|
||||
$user,
|
||||
$object,
|
||||
PhabricatorPolicyCapability::CAN_VIEW);
|
||||
if ($can_see) {
|
||||
$phids[] = $user->getPHID();
|
||||
foreach ($users as $user) {
|
||||
$can_see = PhabricatorPolicyFilter::hasCapability(
|
||||
$user,
|
||||
$object,
|
||||
PhabricatorPolicyCapability::CAN_VIEW);
|
||||
if ($can_see) {
|
||||
$phids[] = $user->getPHID();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue