Skip to content

Commit 7bf716f

Browse files
committed
Fixed: admin coudn't see flat categories in Dashboard
1 parent 365e5d7 commit 7bf716f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vanilla/applications/vanilla/models/class.categorymodel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,14 @@ public function getTreeAsFlat($id, $offset = null, $limit = null, $filter = null
10841084
{
10851085
$query = $this->SQL->from('Category c');
10861086

1087+
if(!$filter) {
1088+
if (Gdn::session()->isValid()) {
1089+
$filter = [];
1090+
$filter['UserID'] = Gdn::session()->UserID;
1091+
$filter['isAdmin'] = Gdn::session()->User->Admin;
1092+
}
1093+
}
1094+
10871095
//FIX: https://github.com/topcoder-platform/forums/issues/422
10881096
if (!val('isAdmin', $filter, false)) {
10891097
if (val('UserID', $filter, false)) {

0 commit comments

Comments
 (0)