Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
Show All 13 Lines | protected function defineParamTypes() { | ||||
return array(); | return array(); | ||||
} | } | ||||
protected function defineReturnType() { | protected function defineReturnType() { | ||||
return 'nonempty dict<string, wild>'; | return 'nonempty dict<string, wild>'; | ||||
} | } | ||||
public function getRequiredScope() { | public function getRequiredScope() { | ||||
return PhabricatorOAuthServerScope::SCOPE_WHOAMI; | return self::SCOPE_ALWAYS; | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$person = id(new PhabricatorPeopleQuery()) | $person = id(new PhabricatorPeopleQuery()) | ||||
->setViewer($request->getUser()) | ->setViewer($request->getUser()) | ||||
->needProfileImage(true) | ->needProfileImage(true) | ||||
->withPHIDs(array($request->getUser()->getPHID())) | ->withPHIDs(array($request->getUser()->getPHID())) | ||||
->executeOne(); | ->executeOne(); | ||||
return $this->buildUserInformationDictionary( | return $this->buildUserInformationDictionary( | ||||
$person, | $person, | ||||
$with_email = true, | $with_email = true, | ||||
$with_availability = false); | $with_availability = false); | ||||
} | } | ||||
} | } |