luci-base: dispatcher.lua: honour acl_depends annotations in Lua controllers

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-04-19 17:13:49 +02:00
parent f76a020db1
commit 760763a7b5

View file

@ -324,6 +324,14 @@ local function tree_to_json(node, json)
end
end
if type(subnode.acl_depends) == "table" then
for _, acl in ipairs(subnode.acl_depends) do
spec.depends = spec.depends or {}
spec.depends.acl = spec.depends.acl or {}
spec.depends.acl[#spec.depends.acl + 1] = acl
end
end
if (subnode.sysauth_authenticator ~= nil) or
(subnode.sysauth ~= nil and subnode.sysauth ~= false)
then