summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/dispatcher.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-19 17:13:49 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-19 17:17:26 +0200
commit760763a7b5da42860c6c2d63478859bb02fa9104 (patch)
tree9e3afaa1b2ae605a802f8828d93c5813d735d74f /modules/luci-base/luasrc/dispatcher.lua
parentf76a020db1936e66551e1e33c6bbc1fb6bc727e3 (diff)
luci-base: dispatcher.lua: honour acl_depends annotations in Lua controllers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/dispatcher.lua')
-rw-r--r--modules/luci-base/luasrc/dispatcher.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua
index e132044625..d4ba0a95e4 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