Differential D7943 Diff 17985 src/applications/project/controller/PhabricatorProjectMoveController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectMoveController.php
- This file was added.
<?php | |||||
final class PhabricatorProjectMoveController | |||||
extends PhabricatorProjectController { | |||||
private $id; | |||||
public function willProcessRequest(array $data) { | |||||
$this->id = $data['id']; | |||||
} | |||||
public function processRequest() { | |||||
$request = $this->getRequest(); | |||||
$viewer = $request->getUser(); | |||||
$project = id(new PhabricatorProjectQuery()) | |||||
->setViewer($viewer) | |||||
->requireCapabilities( | |||||
array( | |||||
PhabricatorPolicyCapability::CAN_VIEW, | |||||
PhabricatorPolicyCapability::CAN_EDIT, | |||||
)) | |||||
->withIDs(array($this->id)) | |||||
->executeOne(); | |||||
if (!$project) { | |||||
return new Aphront404Response(); | |||||
} | |||||
return id(new AphrontAjaxResponse())->setContent(array()); | |||||
} | |||||
} |