mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
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
This commit is contained in:
parent
1c2041583c
commit
0ae08b394c
1 changed files with 12 additions and 1 deletions
|
@ -112,12 +112,23 @@ abstract class DiffusionSSHWorkflow extends PhabricatorSSHWorkflow {
|
|||
final public function execute(PhutilArgumentParser $args) {
|
||||
$this->args = $args;
|
||||
|
||||
$viewer = $this->getUser();
|
||||
$have_diffusion = PhabricatorApplication::isClassInstalledForViewer(
|
||||
'PhabricatorDiffusionApplication',
|
||||
$viewer);
|
||||
if (!$have_diffusion) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'You do not have permission to access the Diffusion application, '.
|
||||
'so you can not interact with repositories over SSH.'));
|
||||
}
|
||||
|
||||
$repository = $this->identifyRepository();
|
||||
$this->setRepository($repository);
|
||||
|
||||
$is_cluster_request = $this->getIsClusterRequest();
|
||||
$uri = $repository->getAlmanacServiceURI(
|
||||
$this->getUser(),
|
||||
$viewer,
|
||||
$is_cluster_request,
|
||||
array(
|
||||
'ssh',
|
||||
|
|
Loading…
Reference in a new issue