1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Don't require access to default EditConfiguration to view objects

Currently, to render comment actions you need to be able to see the
default form. Just make this work for now until it gets cleaned up.
This commit is contained in:
epriestley 2015-12-04 16:58:21 -08:00
parent 273e22d59f
commit 5977215437

View file

@ -191,12 +191,19 @@ abstract class PhabricatorEditEngine
}
private function loadEditEngineConfiguration($key) {
$viewer = $this->getViewer();
if ($key === null) {
$key = self::EDITENGINECONFIG_DEFAULT;
// TODO: At least for now, we need to load the default configuration
// in some cases (editing, comment actions) even if the viewer can not
// otherwise see it. This should be cleaned up eventually, but we can
// safely use the omnipotent user for now without policy violations.
$viewer = PhabricatorUser::getOmnipotentUser();
}
$config = id(new PhabricatorEditEngineConfigurationQuery())
->setViewer($this->getViewer())
->setViewer($viewer)
->withEngineKeys(array($this->getEngineKey()))
->withIdentifiers(array($key))
->executeOne();