Allows alert access to admins and non-admins w/o allowed networks

Implements #5324
This commit is contained in:
Simone Mainardi 2021-05-26 09:50:28 +02:00
parent 4e5e72bc12
commit 8cfb7b608a
6 changed files with 14 additions and 8 deletions

View file

@ -768,10 +768,17 @@ function hasAlertsDisabled()
end
function hasNindexSupport()
local auth = require "auth"
if not ntop.isPro() or ntop.isWindows() then
return false
end
-- Don't allow nIndex for unauthorized users
if not auth.has_capability(auth.capabilities.historical_flows) then
return false
end
-- TODO optimize
if prefs == nil then
prefs = ntop.getPrefs()