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

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 760763a7b5)
This commit is contained in:
Jo-Philipp Wich 2020-04-19 17:13:49 +02:00
parent 9ad6320876
commit d122f1278b

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