Implements bitmap-based limited privileges for non-admins

Implements #4489
This commit is contained in:
Simone Mainardi 2020-10-09 15:50:22 +02:00
parent a64095f244
commit 049bfdcf4a
26 changed files with 180 additions and 36 deletions

View file

@ -8,15 +8,22 @@ package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
local json = require("dkjson")
local notification_configs = require("notification_configs")
local rest_utils = require "rest_utils"
local auth = require "auth"
-- ################################################
if not auth.has_capability(auth.capabilities.notifications) then
rest_utils.answer(rest_utils.consts.err.not_granted)
return
end
-- ################################################
local action = _POST["action"]
sendHTTPContentTypeHeader('application/json')
if (not haveAdminPrivileges(true)) then
return
end
local endpoint_conf_name = _POST["endpoint_conf_name"]
local response = {}