@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.

Raise a better error for SSH access by users with no permission to use Diffusion

Summary: Fixes T7894.

Test Plan:
```
$ git pull
phabricator-ssh-exec: You do not have permission to access the Diffusion application, so you can not interact with repositories over SSH.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7894

Differential Revision: https://secure.phabricator.com/D12555

+12 -1
+12 -1
src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
··· 112 112 final public function execute(PhutilArgumentParser $args) { 113 113 $this->args = $args; 114 114 115 + $viewer = $this->getUser(); 116 + $have_diffusion = PhabricatorApplication::isClassInstalledForViewer( 117 + 'PhabricatorDiffusionApplication', 118 + $viewer); 119 + if (!$have_diffusion) { 120 + throw new Exception( 121 + pht( 122 + 'You do not have permission to access the Diffusion application, '. 123 + 'so you can not interact with repositories over SSH.')); 124 + } 125 + 115 126 $repository = $this->identifyRepository(); 116 127 $this->setRepository($repository); 117 128 118 129 $is_cluster_request = $this->getIsClusterRequest(); 119 130 $uri = $repository->getAlmanacServiceURI( 120 - $this->getUser(), 131 + $viewer, 121 132 $is_cluster_request, 122 133 array( 123 134 'ssh',