Page MenuHomePhabricator

D12866.diff
No OneTemporary

D12866.diff

diff --git a/src/applications/almanac/storage/AlmanacDevice.php b/src/applications/almanac/storage/AlmanacDevice.php
--- a/src/applications/almanac/storage/AlmanacDevice.php
+++ b/src/applications/almanac/storage/AlmanacDevice.php
@@ -240,7 +240,7 @@
PhabricatorDestructionEngine $engine) {
$interfaces = id(new AlmanacInterfaceQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withDevicePHIDs(array($this->getPHID()))
->execute();
foreach ($interfaces as $interface) {
diff --git a/src/applications/almanac/storage/AlmanacInterface.php b/src/applications/almanac/storage/AlmanacInterface.php
--- a/src/applications/almanac/storage/AlmanacInterface.php
+++ b/src/applications/almanac/storage/AlmanacInterface.php
@@ -119,7 +119,7 @@
PhabricatorDestructionEngine $engine) {
$bindings = id(new AlmanacBindingQuery())
- ->setViewer($this->getViewer())
+ ->setViewer($engine->getViewer())
->withInterfacePHIDs(array($this->getPHID()))
->execute();
foreach ($bindings as $binding) {
diff --git a/src/applications/almanac/storage/AlmanacNetwork.php b/src/applications/almanac/storage/AlmanacNetwork.php
--- a/src/applications/almanac/storage/AlmanacNetwork.php
+++ b/src/applications/almanac/storage/AlmanacNetwork.php
@@ -103,7 +103,7 @@
PhabricatorDestructionEngine $engine) {
$interfaces = id(new AlmanacInterfaceQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withNetworkPHIDs(array($this->getPHID()))
->execute();
diff --git a/src/applications/almanac/storage/AlmanacService.php b/src/applications/almanac/storage/AlmanacService.php
--- a/src/applications/almanac/storage/AlmanacService.php
+++ b/src/applications/almanac/storage/AlmanacService.php
@@ -221,7 +221,7 @@
PhabricatorDestructionEngine $engine) {
$bindings = id(new AlmanacBindingQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withServicePHIDs(array($this->getPHID()))
->execute();
foreach ($bindings as $binding) {
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -550,7 +550,7 @@
$this->openTransaction();
$diffs = id(new DifferentialDiffQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withRevisionIDs(array($this->getID()))
->execute();
foreach ($diffs as $diff) {
diff --git a/src/applications/diviner/storage/DivinerLiveBook.php b/src/applications/diviner/storage/DivinerLiveBook.php
--- a/src/applications/diviner/storage/DivinerLiveBook.php
+++ b/src/applications/diviner/storage/DivinerLiveBook.php
@@ -91,7 +91,7 @@
$this->openTransaction();
$atoms = id(new DivinerAtomQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withBookPHIDs(array($this->getPHID()))
->withIncludeGhosts(true)
->withIncludeUndocumentable(true)
diff --git a/src/applications/files/controller/PhabricatorFileTransformController.php b/src/applications/files/controller/PhabricatorFileTransformController.php
--- a/src/applications/files/controller/PhabricatorFileTransformController.php
+++ b/src/applications/files/controller/PhabricatorFileTransformController.php
@@ -104,8 +104,9 @@
}
private function destroyTransform(PhabricatorTransformedFile $xform) {
+ $engine = new PhabricatorDestructionEngine();
$file = id(new PhabricatorFileQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withPHIDs(array($xform->getTransformedPHID()))
->executeOne();
@@ -114,7 +115,6 @@
if (!$file) {
$xform->delete();
} else {
- $engine = new PhabricatorDestructionEngine();
$engine->destroyObject($file);
}
diff --git a/src/applications/files/storage/PhabricatorFileChunk.php b/src/applications/files/storage/PhabricatorFileChunk.php
--- a/src/applications/files/storage/PhabricatorFileChunk.php
+++ b/src/applications/files/storage/PhabricatorFileChunk.php
@@ -91,7 +91,7 @@
$data_phid = $this->getDataFilePHID();
if ($data_phid) {
$data_file = id(new PhabricatorFileQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withPHIDs(array($data_phid))
->executeOne();
if ($data_file) {
diff --git a/src/applications/paste/storage/PhabricatorPaste.php b/src/applications/paste/storage/PhabricatorPaste.php
--- a/src/applications/paste/storage/PhabricatorPaste.php
+++ b/src/applications/paste/storage/PhabricatorPaste.php
@@ -172,7 +172,7 @@
if ($this->filePHID) {
$file = id(new PhabricatorFileQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($engine->getViewer())
->withPHIDs(array($this->filePHID))
->executeOne();
if ($file) {
diff --git a/src/applications/system/engine/PhabricatorDestructionEngine.php b/src/applications/system/engine/PhabricatorDestructionEngine.php
--- a/src/applications/system/engine/PhabricatorDestructionEngine.php
+++ b/src/applications/system/engine/PhabricatorDestructionEngine.php
@@ -4,6 +4,10 @@
private $rootLogID;
+ public function getViewer() {
+ return PhabricatorUser::getOmnipotentUser();
+ }
+
public function destroyObject(PhabricatorDestructibleInterface $object) {
$log = id(new PhabricatorSystemDestructionLog())
->setEpoch(time())

File Metadata

Mime Type
text/plain
Expires
May 14 2024, 11:11 PM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6295762
Default Alt Text
D12866.diff (5 KB)

Event Timeline