Skip to content

Commit bbca383

Browse files
committed
core (fix) search for all user who can view document fix #2015
1 parent 9ac7c8a commit bbca383

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/Controllers/Search.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Search extends AbstractController implements ManagerTheme\PageControllerIn
1717
public function canView(): bool
1818
{
1919
return $this->managerTheme->getCore()
20-
->hasPermission('settings');
20+
->hasPermission('view_document');
2121
}
2222

2323
public function checkLocked(): ?string
@@ -137,7 +137,7 @@ protected function getResults()
137137
$mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0;
138138
if ($mgrRole != 1) {
139139
if (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) {
140-
$searchQuery = $searchQuery->join('document_groups', 'site_content.id', '=', 'document_groups.document')
140+
$searchQuery = $searchQuery->leftJoin('document_groups', 'site_content.id', '=', 'document_groups.document')
141141
->where(function ($query) use ($searchfields) {
142142
$query->where('privatemgr', 0)
143143
->orWhereIn('document_group', $_SESSION['mgrDocgroups']);
@@ -177,7 +177,7 @@ protected function getResults()
177177
if ($result['type'] == 'reference') {
178178
$result['iconClass'] .= $this->managerTheme->getStyle('tree_linkgo');
179179
} elseif ($result['isfolder'] == 0) {
180-
$result['iconClass'] .= isset($icons[$result['contenttype']]) ? $icons[$result['contenttype']] : $this->managerTheme->getStyle('icon_document');
180+
$result['iconClass'] .= isset($result['contenttype'], $icons[$result['contenttype']]) ? $icons[$result['contenttype']] : $this->managerTheme->getStyle('icon_document');
181181
} else {
182182
$result['iconClass'] .= $this->managerTheme->getStyle('icon_folder');
183183
}

0 commit comments

Comments
 (0)