Changeset View
Changeset View
Standalone View
Standalone View
src/applications/policy/filter/PhabricatorPolicyFilter.php
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | public function rejectObject( | ||||
// empty handle if a real PHID isn't available. | // empty handle if a real PHID isn't available. | ||||
$phid = nonempty($object->getPHID(), PhabricatorPHIDConstants::PHID_VOID); | $phid = nonempty($object->getPHID(), PhabricatorPHIDConstants::PHID_VOID); | ||||
$handle = id(new PhabricatorHandleQuery()) | $handle = id(new PhabricatorHandleQuery()) | ||||
->setViewer($this->viewer) | ->setViewer($this->viewer) | ||||
->withPHIDs(array($phid)) | ->withPHIDs(array($phid)) | ||||
->executeOne(); | ->executeOne(); | ||||
$object_name = pht( | |||||
'%s %s', | |||||
$handle->getTypeName(), | |||||
$handle->getObjectName()); | |||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | ||||
if ($is_serious) { | if ($is_serious) { | ||||
$title = pht( | $title = pht( | ||||
'Access Denied: %s', | 'Access Denied: %s', | ||||
$object_name); | $handle->getObjectName()); | ||||
} else { | } else { | ||||
$title = pht( | $title = pht( | ||||
'You Shall Not Pass: %s', | 'You Shall Not Pass: %s', | ||||
$object_name); | $handle->getObjectName()); | ||||
} | } | ||||
$full_message = pht( | $full_message = pht( | ||||
'[%s] (%s) %s // %s', | '[%s] (%s) %s // %s', | ||||
$title, | $title, | ||||
$capability_name, | $capability_name, | ||||
$rejection, | $rejection, | ||||
implode(' ', $details)); | implode(' ', $details)); | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |