Respect device access for health mempools page (#12356)

This commit is contained in:
Tony Murray
2020-11-25 10:43:57 -06:00
committed by GitHub
parent 5d3e06ee69
commit 39f6b35bf0

View File

@@ -51,10 +51,10 @@ class MempoolsController extends TableController
protected function baseQuery($request)
{
if ($request->get('view') == 'graphs') {
return Device::query()->has('mempools')->with('mempools');
return Device::hasAccess($request->user())->has('mempools')->with('mempools');
}
$query = Mempool::query()->with('device');
$query = Mempool::hasAccess($request->user())->with('device');
// join devices table to sort by hostname or search
if (array_key_exists('hostname', $request->get('sort', $this->default_sort)) || $request->get('searchPhrase')) {