Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/method/ConduitAPIMethod.php
Show All 9 Lines | abstract class ConduitAPIMethod | ||||
implements PhabricatorPolicyInterface { | implements PhabricatorPolicyInterface { | ||||
private $viewer; | private $viewer; | ||||
const METHOD_STATUS_STABLE = 'stable'; | const METHOD_STATUS_STABLE = 'stable'; | ||||
const METHOD_STATUS_UNSTABLE = 'unstable'; | const METHOD_STATUS_UNSTABLE = 'unstable'; | ||||
const METHOD_STATUS_DEPRECATED = 'deprecated'; | const METHOD_STATUS_DEPRECATED = 'deprecated'; | ||||
const SCOPE_NEVER = 'scope.never'; | |||||
const SCOPE_ALWAYS = 'scope.always'; | |||||
/** | /** | ||||
* Get a short, human-readable text summary of the method. | * Get a short, human-readable text summary of the method. | ||||
* | * | ||||
* @return string Short summary of method. | * @return string Short summary of method. | ||||
* @task info | * @task info | ||||
*/ | */ | ||||
public function getMethodSummary() { | public function getMethodSummary() { | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | public function getMethodStatusDescription() { | ||||
return null; | return null; | ||||
} | } | ||||
public function getErrorDescription($error_code) { | public function getErrorDescription($error_code) { | ||||
return idx($this->getErrorTypes(), $error_code, pht('Unknown Error')); | return idx($this->getErrorTypes(), $error_code, pht('Unknown Error')); | ||||
} | } | ||||
public function getRequiredScope() { | public function getRequiredScope() { | ||||
// by default, conduit methods are not accessible via OAuth | return self::SCOPE_NEVER; | ||||
return PhabricatorOAuthServerScope::SCOPE_NOT_ACCESSIBLE; | |||||
} | } | ||||
public function executeMethod(ConduitAPIRequest $request) { | public function executeMethod(ConduitAPIRequest $request) { | ||||
$this->setViewer($request->getUser()); | $this->setViewer($request->getUser()); | ||||
return $this->execute($request); | return $this->execute($request); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines |