Differential D14824 Diff 35840 src/applications/transactions/controller/PhabricatorEditEngineConfigurationSortController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/controller/PhabricatorEditEngineConfigurationSortController.php
Show All 33 Lines | public function handleRequest(AphrontRequest $request) { | ||||
if ($is_create) { | if ($is_create) { | ||||
$query->withIsDefault(true); | $query->withIsDefault(true); | ||||
} else { | } else { | ||||
$query->withIsEdit(true); | $query->withIsEdit(true); | ||||
} | } | ||||
$configs = $query->execute(); | $configs = $query->execute(); | ||||
// Do this check here (instead of in the Query above) to get a proper | |||||
// policy exception if the user doesn't satisfy | |||||
foreach ($configs as $config) { | |||||
PhabricatorPolicyFilter::requireCapability( | |||||
$viewer, | |||||
$config, | |||||
PhabricatorPolicyCapability::CAN_EDIT); | |||||
} | |||||
if ($is_create) { | if ($is_create) { | ||||
$configs = msort($configs, 'getCreateSortKey'); | $configs = msort($configs, 'getCreateSortKey'); | ||||
} else { | } else { | ||||
$configs = msort($configs, 'getEditSortKey'); | $configs = msort($configs, 'getEditSortKey'); | ||||
} | } | ||||
if ($request->isFormPost()) { | if ($request->isFormPost()) { | ||||
$form_order = $request->getStrList('formOrder'); | $form_order = $request->getStrList('formOrder'); | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |