@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+9 -5
+9 -5
src/applications/meta/controller/PhabricatorApplicationUninstallController.php
··· 6 6 private $application; 7 7 private $action; 8 8 9 - public function shouldRequireAdmin() { 10 - return true; 11 - } 12 - 13 9 public function willProcessRequest(array $data) { 14 10 $this->application = $data['application']; 15 11 $this->action = $data['action']; ··· 19 15 $request = $this->getRequest(); 20 16 $user = $request->getUser(); 21 17 22 - $selected = PhabricatorApplication::getByClass($this->application); 18 + $selected = id(new PhabricatorApplicationQuery()) 19 + ->setViewer($user) 20 + ->withClasses(array($this->application)) 21 + ->requireCapabilities( 22 + array( 23 + PhabricatorPolicyCapability::CAN_VIEW, 24 + PhabricatorPolicyCapability::CAN_EDIT, 25 + )) 26 + ->executeOne(); 23 27 24 28 if (!$selected) { 25 29 return new Aphront404Response();