From 597721543735c1c67b17a98b5fd76a6cfebaf7b0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 4 Dec 2015 16:58:21 -0800 Subject: [PATCH] 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. --- .../transactions/editengine/PhabricatorEditEngine.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php index 43af4fe935..8b47686616 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngine.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php @@ -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();