mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-03 04:02:43 +01:00
32 lines
726 B
PHP
32 lines
726 B
PHP
|
<?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());
|
||
|
}
|
||
|
}
|