1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Uninstalling an application, as a non-admin, should give the same modal as clicking "Edit Policies"

Summary: Fixes T8893, Uninstalling an application, as a non-admin, should give the same modal as clicking "Edit Policies".

Test Plan: Open `/applications/view/PhabricatorAuditApplication/` and confirm that "Edit Policies" and "Uninstall" result in the same modal.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T8893

Differential Revision: https://secure.phabricator.com/D13753
This commit is contained in:
lkassianik 2015-07-28 20:21:12 -07:00
parent fb13692bd3
commit b24935df2f

View file

@ -6,10 +6,6 @@ final class PhabricatorApplicationUninstallController
private $application;
private $action;
public function shouldRequireAdmin() {
return true;
}
public function willProcessRequest(array $data) {
$this->application = $data['application'];
$this->action = $data['action'];
@ -19,7 +15,15 @@ final class PhabricatorApplicationUninstallController
$request = $this->getRequest();
$user = $request->getUser();
$selected = PhabricatorApplication::getByClass($this->application);
$selected = id(new PhabricatorApplicationQuery())
->setViewer($user)
->withClasses(array($this->application))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
))
->executeOne();
if (!$selected) {
return new Aphront404Response();