Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14019430
D14761.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D14761.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 10:06 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715622
Default Alt Text
D14761.diff (3 KB)
Attached To
Mode
D14761: Give ConduitAPIMethod->getMethodDescription() access to a real Viewer
Attached
Detach File
Event Timeline
Log In to Comment