mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 09:12: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:
parent
fb13692bd3
commit
b24935df2f
1 changed files with 9 additions and 5 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue