projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f76a020
)
luci-base: dispatcher.lua: honour acl_depends annotations in Lua controllers
author
Jo-Philipp Wich
<jo@mein.io>
Sun, 19 Apr 2020 15:13:49 +0000
(17:13 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Sun, 19 Apr 2020 15:17:26 +0000
(17:17 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/modules/luci-base/luasrc/dispatcher.lua
b/modules/luci-base/luasrc/dispatcher.lua
index e13204462553b7e36a4052505b1fe17f073e3fcb..d4ba0a95e4e06bcd2c8bba3896a82b53f8ffb05f 100644
(file)
--- 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