From d122f1278b440c3c09f222d318333f773e97faa3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 19 Apr 2020 17:13:49 +0200 Subject: [PATCH] luci-base: dispatcher.lua: honour acl_depends annotations in Lua controllers Signed-off-by: Jo-Philipp Wich (cherry picked from commit 760763a7b5da42860c6c2d63478859bb02fa9104) --- modules/luci-base/luasrc/dispatcher.lua | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.25.1