mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +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
|
|
@ -9,6 +9,17 @@ require "lua_utils"
|
|||
local json = require("dkjson")
|
||||
local user_scripts = require("user_scripts")
|
||||
local alert_consts = require("alert_consts")
|
||||
local rest_utils = require "rest_utils"
|
||||
local auth = require "auth"
|
||||
|
||||
-- ################################################
|
||||
|
||||
if not auth.has_capability(auth.capabilities.user_scripts) then
|
||||
rest_utils.answer(rest_utils.consts.err.not_granted)
|
||||
return
|
||||
end
|
||||
|
||||
-- ################################################
|
||||
|
||||
sendHTTPContentTypeHeader('application/json')
|
||||
|
||||
|
|
@ -16,11 +27,6 @@ local subdir = _POST["script_subdir"]
|
|||
local confset_id = tonumber(_POST["confset_id"] or user_scripts.DEFAULT_CONFIGSET_ID)
|
||||
local script_key = _POST["script_key"]
|
||||
|
||||
if(not isAdministrator()) then
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Admin privileges required")
|
||||
return
|
||||
end
|
||||
|
||||
-- ################################################
|
||||
|
||||
if(_POST["JSON"] == nil) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue