From: Jo-Philipp Wich Date: Sun, 19 Apr 2020 15:13:49 +0000 (+0200) Subject: luci-base: dispatcher.lua: honour acl_depends annotations in Lua controllers X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=760763a7b5da42860c6c2d63478859bb02fa9104;p=oweals%2Fluci.git luci-base: dispatcher.lua: honour acl_depends annotations in Lua controllers Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index e13204462..d4ba0a95e 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -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