mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-20 03:31:10 +01:00
Show "Search" in menubar while logged out if users can access it
Summary: Ref T603. If an install allows acccess by logged-out users, show search. (A lot of the search typeahead results, although visible to the user, don't lead anywhere interesting right now. We can clean this up in the future.) Test Plan: As a logged out user, searched for some stuff. It worked. Also, I only found results I could see, which is quite heartening. Reviewers: btrahan, chad Reviewed By: btrahan CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D7153
This commit is contained in:
parent
7f0d0e4e6c
commit
efc8373184
2 changed files with 13 additions and 1 deletions
|
@ -8,6 +8,10 @@ final class PhabricatorSearchController
|
|||
|
||||
private $key;
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->key = idx($data, 'key');
|
||||
}
|
||||
|
@ -273,9 +277,14 @@ final class PhabricatorSearchController
|
|||
$results = null;
|
||||
}
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Search')));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$search_panel,
|
||||
$results,
|
||||
),
|
||||
|
|
|
@ -91,7 +91,10 @@ final class PhabricatorMainMenuView extends AphrontView {
|
|||
'helpURI' => '/help/keyboardshortcut/',
|
||||
);
|
||||
|
||||
if ($user->isLoggedIn()) {
|
||||
$show_search = ($user->isLoggedIn()) ||
|
||||
(PhabricatorEnv::getEnvConfig('policy.allow-public'));
|
||||
|
||||
if ($show_search) {
|
||||
$search = new PhabricatorMainMenuSearchView();
|
||||
$search->setUser($user);
|
||||
$search->setScope($this->getDefaultSearchScope());
|
||||
|
|
Loading…
Reference in a new issue