diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php index bae946d1fb..1b6788dd5e 100644 --- a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php +++ b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php @@ -80,6 +80,7 @@ final class PhabricatorDashboardPanelTypeQuery } $engine->setViewer($viewer); + $engine->setContext(PhabricatorApplicationSearchEngine::CONTEXT_PANEL); $key = $panel->getProperty('key'); if ($engine->isBuiltinQuery($key)) { diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php index 4372996aa8..501e095aba 100644 --- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php +++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php @@ -532,15 +532,20 @@ final class ManiphestTaskSearchEngine $viewer = $this->requireViewer(); - $can_edit_priority = PhabricatorPolicyFilter::hasCapability( - $viewer, - $this->getApplication(), - ManiphestCapabilityEditPriority::CAPABILITY); + if ($this->isPanelContext()) { + $can_edit_priority = false; + $can_bulk_edit = false; + } else { + $can_edit_priority = PhabricatorPolicyFilter::hasCapability( + $viewer, + $this->getApplication(), + ManiphestCapabilityEditPriority::CAPABILITY); - $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( - $viewer, - $this->getApplication(), - ManiphestCapabilityBulkEdit::CAPABILITY); + $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( + $viewer, + $this->getApplication(), + ManiphestCapabilityBulkEdit::CAPABILITY); + } return id(new ManiphestTaskResultListView()) ->setUser($viewer) diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 0869739d6d..9dd2519ff0 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -22,6 +22,10 @@ abstract class PhabricatorApplicationSearchEngine { private $errors = array(); private $customFields = false; private $request; + private $context; + + const CONTEXT_LIST = 'list'; + const CONTEXT_PANEL = 'panel'; public function setViewer(PhabricatorUser $viewer) { $this->viewer = $viewer; @@ -35,6 +39,15 @@ abstract class PhabricatorApplicationSearchEngine { return $this->viewer; } + public function setContext($context) { + $this->context = $context; + return $this; + } + + public function isPanelContext() { + return ($this->context == self::CONTEXT_PANEL); + } + public function saveQuery(PhabricatorSavedQuery $query) { $query->setEngineClassName(get_class($this));