Page MenuHomePhabricator

D14761.diff
No OneTemporary

D14761.diff

diff --git a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
--- a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
@@ -19,6 +19,8 @@
return new Aphront404Response();
}
+ $method->setViewer($viewer);
+
$call_uri = '/api/'.$method->getAPIMethodName();
$status = $method->getMethodStatus();
diff --git a/src/applications/conduit/method/ConduitAPIMethod.php b/src/applications/conduit/method/ConduitAPIMethod.php
--- a/src/applications/conduit/method/ConduitAPIMethod.php
+++ b/src/applications/conduit/method/ConduitAPIMethod.php
@@ -9,6 +9,7 @@
extends Phobject
implements PhabricatorPolicyInterface {
+ private $viewer;
const METHOD_STATUS_STABLE = 'stable';
const METHOD_STATUS_UNSTABLE = 'unstable';
@@ -46,8 +47,6 @@
abstract protected function execute(ConduitAPIRequest $request);
- public function __construct() {}
-
public function getParamTypes() {
$types = $this->defineParamTypes();
@@ -110,6 +109,8 @@
}
public function executeMethod(ConduitAPIRequest $request) {
+ $this->setViewer($request->getUser());
+
return $this->execute($request);
}
@@ -211,6 +212,15 @@
return null;
}
+ final public function setViewer(PhabricatorUser $viewer) {
+ $this->viewer = $viewer;
+ return $this;
+ }
+
+ final public function getViewer() {
+ return $this->viewer;
+ }
+
/* -( Paging Results )----------------------------------------------------- */
diff --git a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
--- a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
+++ b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
@@ -39,8 +39,7 @@
}
final public function getMethodDescription() {
- // TODO: We don't currently have a real viewer in this method.
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$engine = $this->newSearchEngine()
->setViewer($viewer);
@@ -76,7 +75,8 @@
}
```
-These builtin and saved queries are available:
+You can use these keys to select builtin queries and your configured saved
+queries:
EOTEXT
);
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
@@ -38,8 +38,7 @@
}
final public function getMethodDescription() {
- // TODO: We don't currently have a real viewer in this method.
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$engine = $this->newEditEngine()
->setViewer($viewer);

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 6:46 AM (1 w, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715622
Default Alt Text
D14761.diff (3 KB)

Event Timeline