mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Implements bitmap-based limited privileges for non-admins
Implements #4489
This commit is contained in:
parent
a64095f244
commit
049bfdcf4a
26 changed files with 180 additions and 36 deletions
|
|
@ -12,6 +12,7 @@ local am_import_export = plugins_utils.loadModule("active_monitoring", "am_impor
|
|||
local json = require "dkjson"
|
||||
local rest_utils = require "rest_utils"
|
||||
local import_export_rest_utils = require "import_export_rest_utils"
|
||||
local auth = require "auth"
|
||||
|
||||
--
|
||||
-- Reset Active Monitoring configuration
|
||||
|
|
@ -20,7 +21,7 @@ local import_export_rest_utils = require "import_export_rest_utils"
|
|||
-- NOTE: in case of invalid login, no error is returned but redirected to login
|
||||
--
|
||||
|
||||
if not haveAdminPrivileges() then
|
||||
if not auth.has_capability(auth.capabilities.active_monitoring) then
|
||||
rest_utils.answer(rest_utils.consts.err.not_granted)
|
||||
return
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue