Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | protected function requireWriteAccess($protocol_command = null) { | ||||
if ($viewer->isOmnipotent()) { | if ($viewer->isOmnipotent()) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'This request is authenticated as a cluster device, but is '. | 'This request is authenticated as a cluster device, but is '. | ||||
'performing a write. Writes must be performed with a real '. | 'performing a write. Writes must be performed with a real '. | ||||
'user account.')); | 'user account.')); | ||||
} | } | ||||
if ($repository->isReadOnly()) { | |||||
throw new Exception($repository->getReadOnlyMessageForDisplay()); | |||||
} | |||||
$protocol = PhabricatorRepositoryURI::BUILTIN_PROTOCOL_SSH; | $protocol = PhabricatorRepositoryURI::BUILTIN_PROTOCOL_SSH; | ||||
if ($repository->canServeProtocol($protocol, true)) { | if ($repository->canServeProtocol($protocol, true)) { | ||||
$can_push = PhabricatorPolicyFilter::hasCapability( | $can_push = PhabricatorPolicyFilter::hasCapability( | ||||
$viewer, | $viewer, | ||||
$repository, | $repository, | ||||
DiffusionPushCapability::CAPABILITY); | DiffusionPushCapability::CAPABILITY); | ||||
if (!$can_push) { | if (!$can_push) { | ||||
throw new Exception( | throw new Exception( | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |