Differential D15943 Diff 38392 src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php
| <?php | <?php | ||||
| final class PhabricatorAuthSSHKeyEditController | final class PhabricatorAuthSSHKeyEditController | ||||
| extends PhabricatorAuthSSHKeyController { | extends PhabricatorAuthSSHKeyController { | ||||
| public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $id = $request->getURIData('id'); | $id = $request->getURIData('id'); | ||||
| if ($id) { | if ($id) { | ||||
| $key = id(new PhabricatorAuthSSHKeyQuery()) | $key = id(new PhabricatorAuthSSHKeyQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIDs(array($id)) | ->withIDs(array($id)) | ||||
| ->withIsActive(true) | |||||
| ->requireCapabilities( | ->requireCapabilities( | ||||
| array( | array( | ||||
| PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
| PhabricatorPolicyCapability::CAN_EDIT, | PhabricatorPolicyCapability::CAN_EDIT, | ||||
| )) | )) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if (!$key) { | if (!$key) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| ▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines | |||||