mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Check privileges in rest set
This commit is contained in:
parent
c623f21ba0
commit
a1d9fd3695
1 changed files with 5 additions and 0 deletions
|
|
@ -25,6 +25,11 @@ local res = {}
|
|||
local host_info = url2hostinfo(_POST)
|
||||
local custom_name = _POST["custom_name"]
|
||||
|
||||
if not haveAdminPrivileges() then
|
||||
print(rest_utils.rc(rest_utils.consts_not_granted))
|
||||
return
|
||||
end
|
||||
|
||||
if host_info == nil or isEmptyString(host_info["host"]) or custom_name == nil then
|
||||
print(rest_utils.rc(rest_utils.consts_invalid_args))
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue