Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/luci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-19 18:13:49 +0300
committerJo-Philipp Wich <jo@mein.io>2020-04-19 18:17:26 +0300
commit760763a7b5da42860c6c2d63478859bb02fa9104 (patch)
tree9e3afaa1b2ae605a802f8828d93c5813d735d74f
parentf76a020db1936e66551e1e33c6bbc1fb6bc727e3 (diff)
luci-base: dispatcher.lua: honour acl_depends annotations in Lua controllers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-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