From: Jo-Philipp Wich Date: Sun, 19 Apr 2020 15:14:58 +0000 (+0200) Subject: applications: add ACL dependency annotations to legacy controllers X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=74da73b012a7ac271d683f11d98de170215ae661;p=oweals%2Fluci.git applications: add ACL dependency annotations to legacy controllers Signed-off-by: Jo-Philipp Wich --- diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua index 11a4abb9f..cef875bbb 100644 --- a/applications/luci-app-adblock/luasrc/controller/adblock.lua +++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua @@ -3,7 +3,7 @@ module("luci.controller.adblock", package.seeall) function index() - entry({"admin", "services", "adblock"}, firstchild(), _("Adblock"), 60) + entry({"admin", "services", "adblock"}, firstchild(), _("Adblock"), 60).acl_depends = { "luci-app-adblock" } entry({"admin", "services", "adblock", "overview"}, view("adblock/overview"), _("Overview"), 10) entry({"admin", "services", "adblock", "dnsreport"}, view("adblock/dnsreport"), _("DNS Report"), 20) entry({"admin", "services", "adblock", "blacklist"}, view("adblock/blacklist"), _("Edit Blacklist"), 30) diff --git a/applications/luci-app-ahcp/luasrc/controller/ahcp.lua b/applications/luci-app-ahcp/luasrc/controller/ahcp.lua index e97da558b..afae5971d 100644 --- a/applications/luci-app-ahcp/luasrc/controller/ahcp.lua +++ b/applications/luci-app-ahcp/luasrc/controller/ahcp.lua @@ -8,7 +8,7 @@ function index() return end - entry({"admin", "network", "ahcpd"}, cbi("ahcp"), _("AHCP Server"), 90) + entry({"admin", "network", "ahcpd"}, cbi("ahcp"), _("AHCP Server"), 90).acl_depends = { "luci-app-ahcp" } entry({"admin", "network", "ahcpd", "status"}, call("ahcp_status")) end diff --git a/applications/luci-app-aria2/luasrc/controller/aria2.lua b/applications/luci-app-aria2/luasrc/controller/aria2.lua index 4891727a0..52d7c94eb 100644 --- a/applications/luci-app-aria2/luasrc/controller/aria2.lua +++ b/applications/luci-app-aria2/luasrc/controller/aria2.lua @@ -14,8 +14,9 @@ function index() return end - entry({"admin", "services", "aria2"}, - firstchild(), _("Aria2")).dependent = false + local e = entry({"admin", "services", "aria2"}, firstchild(), _("Aria2")) + e.dependent = false + e.acl_depends = { "luci-app-aria2" } entry({"admin", "services", "aria2", "config"}, cbi("aria2/config"), _("Configuration"), 1) diff --git a/applications/luci-app-banip/luasrc/controller/banip.lua b/applications/luci-app-banip/luasrc/controller/banip.lua index 6ada1d516..1befbe986 100644 --- a/applications/luci-app-banip/luasrc/controller/banip.lua +++ b/applications/luci-app-banip/luasrc/controller/banip.lua @@ -13,7 +13,11 @@ function index() if not nixio.fs.access("/etc/config/banip") then return end - entry({"admin", "services", "banip"}, firstchild(), _("banIP"), 40).dependent = false + + local e = entry({"admin", "services", "banip"}, firstchild(), _("banIP"), 40) + e.dependent = false + e.acl_depends = { "luci-app-banip" } + entry({"admin", "services", "banip", "tab_from_cbi"}, cbi("banip/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true entry({"admin", "services", "banip", "ipset"}, template("banip/ipsetview"), _("IPSet-Lookup"), 20).leaf = true entry({"admin", "services", "banip", "ripe"}, template("banip/ripeview"), _("RIPE-Lookup"), 30).leaf = true diff --git a/applications/luci-app-commands/luasrc/controller/commands.lua b/applications/luci-app-commands/luasrc/controller/commands.lua index 433dfa14a..f6227c6e4 100644 --- a/applications/luci-app-commands/luasrc/controller/commands.lua +++ b/applications/luci-app-commands/luasrc/controller/commands.lua @@ -4,7 +4,7 @@ module("luci.controller.commands", package.seeall) function index() - entry({"admin", "system", "commands"}, firstchild(), _("Custom Commands"), 80) + entry({"admin", "system", "commands"}, firstchild(), _("Custom Commands"), 80).acl_depends = { "luci-app-commands" } entry({"admin", "system", "commands", "dashboard"}, template("commands"), _("Dashboard"), 1) entry({"admin", "system", "commands", "config"}, cbi("commands"), _("Configure"), 2) entry({"admin", "system", "commands", "run"}, call("action_run"), nil, 3).leaf = true diff --git a/applications/luci-app-cshark/luasrc/controller/cshark.lua b/applications/luci-app-cshark/luasrc/controller/cshark.lua index 43410a004..a5812a651 100644 --- a/applications/luci-app-cshark/luasrc/controller/cshark.lua +++ b/applications/luci-app-cshark/luasrc/controller/cshark.lua @@ -18,20 +18,26 @@ function index() page.target = cbi("admin_network/cshark") page.title = _("CloudShark") page.order = 70 + page.acl_depends = { "luci-app-cshark" } page = entry({"admin", "network", "cshark_iface_dump_start"}, call("cshark_iface_dump_start"), nil) + page.acl_depends = { "luci-app-cshark" } page.leaf = true page = entry({"admin", "network", "cshark_iface_dump_stop"}, call("cshark_iface_dump_stop"), nil) + page.acl_depends = { "luci-app-cshark" } page.leaf = true page = entry({"admin", "network", "cshark_check_status"}, call("cshark_check_status"), nil) + page.acl_depends = { "luci-app-cshark" } page.leaf = true page = entry({"admin", "network", "cshark_link_list_get"}, call("cshark_link_list_get"), nil) + page.acl_depends = { "luci-app-cshark" } page.leaf = true page = entry({"admin", "network", "cshark_link_list_clear"}, call("cshark_link_list_clear"), nil) + page.acl_depends = { "luci-app-cshark" } page.leaf = true end diff --git a/applications/luci-app-dawn/luasrc/controller/dawn.lua b/applications/luci-app-dawn/luasrc/controller/dawn.lua index 64055b4af..6ba53f13d 100644 --- a/applications/luci-app-dawn/luasrc/controller/dawn.lua +++ b/applications/luci-app-dawn/luasrc/controller/dawn.lua @@ -1,7 +1,10 @@ module("luci.controller.dawn", package.seeall) function index() - entry({ "admin", "dawn" }, firstchild(), "DAWN", 60).dependent = false + local e = entry({ "admin", "dawn" }, firstchild(), "DAWN", 60) + e.dependent = false + e.acl_depends = { "luci-app-dawn" } + entry({ "admin", "dawn", "configure_daemon" }, cbi("dawn/dawn_config"), "Configure DAWN", 1) entry({ "admin", "dawn", "view_network" }, cbi("dawn/dawn_network"), "View Network Overview", 2) entry({ "admin", "dawn", "view_hearing_map" }, cbi("dawn/dawn_hearing_map"), "View Hearing Map", 3) diff --git a/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua b/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua index c05594525..a5d64265f 100644 --- a/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua +++ b/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua @@ -11,7 +11,11 @@ function index() if not nixio.fs.access("/etc/config/dnscrypt-proxy") then nixio.fs.writefile("/etc/config/dnscrypt-proxy", "") end - entry({"admin", "services", "dnscrypt-proxy"}, firstchild(), _("DNSCrypt-Proxy"), 60).dependent = false + + local e = entry({"admin", "services", "dnscrypt-proxy"}, firstchild(), _("DNSCrypt-Proxy"), 60) + e.dependent = false + e.acl_depends = { "luci-app-dnscrypt-proxy" } + entry({"admin", "services", "dnscrypt-proxy", "tab_from_cbi"}, cbi("dnscrypt-proxy/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true entry({"admin", "services", "dnscrypt-proxy", "logfile"}, call("logread"), _("View Logfile"), 20).leaf = true entry({"admin", "services", "dnscrypt-proxy", "advanced"}, firstchild(), _("Advanced"), 100) diff --git a/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua b/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua index d236feae0..9ab541849 100644 --- a/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua +++ b/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua @@ -1,7 +1,7 @@ module("luci.controller.https-dns-proxy", package.seeall) function index() if nixio.fs.access("/etc/config/https-dns-proxy") then - entry({"admin", "services", "https-dns-proxy"}, cbi("https-dns-proxy"), _("DNS Over HTTPS Proxy")) + entry({"admin", "services", "https-dns-proxy"}, cbi("https-dns-proxy"), _("DNS Over HTTPS Proxy")).acl_depends = { "luci-app-https-dns-proxy" } entry({"admin", "services", "https-dns-proxy", "action"}, call("https_dns_proxy_action"), nil).leaf = true end end diff --git a/applications/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua b/applications/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua index 46c768401..f8518c4d7 100644 --- a/applications/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua +++ b/applications/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua @@ -12,6 +12,7 @@ function index() page.target = firstchild() page.title = _("VoIP") page.order = 90 + page.acl_depends = { "luci-app-ltqtapi" } entry({"admin", "telephony", "account"}, cbi("luci_ltqtapi/account") , _("Account"), 10) entry({"admin", "telephony", "contact"}, cbi("luci_ltqtapi/contact") , _("Contacts"), 20) diff --git a/applications/luci-app-lxc/luasrc/controller/lxc.lua b/applications/luci-app-lxc/luasrc/controller/lxc.lua index 943211010..6fa1add0f 100644 --- a/applications/luci-app-lxc/luasrc/controller/lxc.lua +++ b/applications/luci-app-lxc/luasrc/controller/lxc.lua @@ -30,12 +30,27 @@ function index() page.target = cbi("lxc") page.title = _("LXC Containers") page.order = 70 + page.acl_depends = { "luci-app-lxc" } - entry({"admin", "services", "lxc_create"}, call("lxc_create"), nil).leaf = true - entry({"admin", "services", "lxc_action"}, call("lxc_action"), nil).leaf = true - entry({"admin", "services", "lxc_get_downloadable"}, call("lxc_get_downloadable"), nil).leaf = true - entry({"admin", "services", "lxc_configuration_get"}, call("lxc_configuration_get"), nil).leaf = true - entry({"admin", "services", "lxc_configuration_set"}, call("lxc_configuration_set"), nil).leaf = true + page = entry({"admin", "services", "lxc_create"}, call("lxc_create"), nil) + page.acl_depends = { "luci-app-lxc" } + page.leaf = true + + page = entry({"admin", "services", "lxc_action"}, call("lxc_action"), nil) + page.acl_depends = { "luci-app-lxc" } + page.leaf = true + + page = entry({"admin", "services", "lxc_get_downloadable"}, call("lxc_get_downloadable"), nil) + page.acl_depends = { "luci-app-lxc" } + page.leaf = true + + page = entry({"admin", "services", "lxc_configuration_get"}, call("lxc_configuration_get"), nil) + page.acl_depends = { "luci-app-lxc" } + page.leaf = true + + page = entry({"admin", "services", "lxc_configuration_set"}, call("lxc_configuration_set"), nil) + page.acl_depends = { "luci-app-lxc" } + page.leaf = true end function lxc_get_downloadable() diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index 35385912c..1fb9083a5 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -16,7 +16,7 @@ function index() entry({"admin", "status", "mwan"}, alias("admin", "status", "mwan", "overview"), - _("Load Balancing"), 600) + _("Load Balancing"), 600).acl_depends = { "luci-app-mwan3" } entry({"admin", "status", "mwan", "overview"}, template("mwan/status_interface")) @@ -38,7 +38,7 @@ function index() entry({"admin", "network", "mwan"}, alias("admin", "network", "mwan", "interface"), - _("Load Balancing"), 600) + _("Load Balancing"), 600).acl_depends = { "luci-app-mwan3" } entry({"admin", "network", "mwan", "globals"}, cbi("mwan/globalsconfig"), diff --git a/applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua b/applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua index 4d0527e33..899e41a7f 100644 --- a/applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua +++ b/applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua @@ -8,12 +8,19 @@ function index() return end - entry({"admin", "status", "realtime", "rate"}, - template("nft-qos/rate"), _("Rate"), 5).leaf = true - entry({"admin", "status", "realtime", "rate_status"}, - call("action_rate")).leaf = true - entry({"admin", "services", "nft-qos"}, cbi("nft-qos/nft-qos"), - _("QoS over Nftables"), 60) + local e + + e = entry({"admin", "status", "realtime", "rate"}, template("nft-qos/rate"), _("Rate"), 5) + e.leaf = true + e.acl_depends = { "luci-app-nft-qos" } + + e = entry({"admin", "status", "realtime", "rate_status"}, call("action_rate")) + e.leaf = true + e.acl_depends = { "luci-app-nft-qos" } + + e = entry({"admin", "services", "nft-qos"}, cbi("nft-qos/nft-qos"), _("QoS over Nftables"), 60) + e.leaf = true + e.acl_depends = { "luci-app-nft-qos" } end function _action_rate(rv, n) diff --git a/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua b/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua index 0d15bea64..2b6490d33 100644 --- a/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua +++ b/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua @@ -4,7 +4,7 @@ module("luci.controller.nlbw", package.seeall) function index() - entry({"admin", "nlbw"}, firstchild(), _("Bandwidth Monitor"), 80) + entry({"admin", "nlbw"}, firstchild(), _("Bandwidth Monitor"), 80).acl_depends = { "luci-app-nlbwmon" } entry({"admin", "nlbw", "display"}, template("nlbw/display"), _("Display"), 1) entry({"admin", "nlbw", "config"}, cbi("nlbw/config"), _("Configuration"), 2) entry({"admin", "nlbw", "backup"}, template("nlbw/backup"), _("Backup"), 3) diff --git a/applications/luci-app-ocserv/luasrc/controller/ocserv.lua b/applications/luci-app-ocserv/luasrc/controller/ocserv.lua index f41b48103..3127f73c6 100644 --- a/applications/luci-app-ocserv/luasrc/controller/ocserv.lua +++ b/applications/luci-app-ocserv/luasrc/controller/ocserv.lua @@ -13,6 +13,7 @@ function index() page = entry({"admin", "vpn", "ocserv"}, alias("admin", "vpn", "ocserv", "main"), _("OpenConnect VPN")) page.dependent = true + page.acl_depends = { "luci-app-ocserv" } page = entry({"admin", "vpn", "ocserv", "main"}, cbi("ocserv/main"), diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua index 22d9a01f1..41897092f 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr.lua @@ -26,6 +26,7 @@ function index() page.target = template("status-olsr/overview") page.title = _("OLSR") page.subindex = true + page.acl_depends = { "luci-app-olsr" } local page = node("admin", "status", "olsr", "json") page.target = call("action_json") @@ -74,7 +75,6 @@ function index() {"admin", "services", "olsrd", "display"}, cbi("olsr/olsrddisplay"), _("Display") ) - end function action_json() diff --git a/applications/luci-app-olsr/luasrc/controller/olsr4.lua b/applications/luci-app-olsr/luasrc/controller/olsr4.lua index 31a3101bc..5c6d887cb 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr4.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr4.lua @@ -13,6 +13,7 @@ function index() cbi("olsr/olsrd"), "OLSR IPv4" ) ol.subindex = true + ol.acl_depends = { "luci-app-olsr" } entry( {"admin", "services", "olsrd", "iface"}, diff --git a/applications/luci-app-olsr/luasrc/controller/olsr6.lua b/applications/luci-app-olsr/luasrc/controller/olsr6.lua index 9fbaa0427..d09ad3398 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr6.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr6.lua @@ -13,6 +13,7 @@ function index() cbi("olsr/olsrd6"), "OLSR IPv6" ) ol.subindex = true + ol.acl_depends = { "luci-app-olsr" } entry( {"admin", "services", "olsrd6", "iface"}, diff --git a/applications/luci-app-openvpn/luasrc/controller/openvpn.lua b/applications/luci-app-openvpn/luasrc/controller/openvpn.lua index 55c29d1c2..2d57e8d3a 100644 --- a/applications/luci-app-openvpn/luasrc/controller/openvpn.lua +++ b/applications/luci-app-openvpn/luasrc/controller/openvpn.lua @@ -5,7 +5,7 @@ module("luci.controller.openvpn", package.seeall) function index() - entry( {"admin", "vpn", "openvpn"}, cbi("openvpn"), _("OpenVPN") ) + entry( {"admin", "vpn", "openvpn"}, cbi("openvpn"), _("OpenVPN") ).acl_depends = { "luci-app-openvpn" } entry( {"admin", "vpn", "openvpn", "basic"}, cbi("openvpn-basic"), nil ).leaf = true entry( {"admin", "vpn", "openvpn", "advanced"}, cbi("openvpn-advanced"), nil ).leaf = true entry( {"admin", "vpn", "openvpn", "file"}, form("openvpn-file"), nil ).leaf = true diff --git a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua index 6439a30c3..808ddbb44 100644 --- a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua +++ b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua @@ -21,7 +21,7 @@ local app_title = "Privoxy WEB proxy" local app_version = "1.0.6-1" function index() - entry( {"admin", "services", "privoxy"}, cbi("privoxy"), _("Privoxy WEB proxy"), 59) + entry( {"admin", "services", "privoxy"}, cbi("privoxy"), _("Privoxy WEB proxy"), 59).acl_depends = { "luci-app-privoxy" } entry( {"admin", "services", "privoxy", "logview"}, call("logread") ).leaf = true entry( {"admin", "services", "privoxy", "startstop"}, post("startstop") ).leaf = true entry( {"admin", "services", "privoxy", "status"}, call("get_pid") ).leaf = true diff --git a/applications/luci-app-radicale/luasrc/controller/radicale.lua b/applications/luci-app-radicale/luasrc/controller/radicale.lua index 0be433a48..291f1b4dc 100644 --- a/applications/luci-app-radicale/luasrc/controller/radicale.lua +++ b/applications/luci-app-radicale/luasrc/controller/radicale.lua @@ -20,7 +20,7 @@ local app_title = I18N.translate("Radicale CalDAV/CardDAV Server") local app_version = "1.1.0-1" function index() - entry( {"admin", "services", "radicale"}, alias("admin", "services", "radicale", "edit"), _("CalDAV/CardDAV"), 58) + entry( {"admin", "services", "radicale"}, alias("admin", "services", "radicale", "edit"), _("CalDAV/CardDAV"), 58).acl_depends = { "luci-app-radicale" } entry( {"admin", "services", "radicale", "edit"}, cbi("radicale") ).leaf = true entry( {"admin", "services", "radicale", "logview"}, call("_logread") ).leaf = true entry( {"admin", "services", "radicale", "startstop"}, post("_startstop") ).leaf = true diff --git a/applications/luci-app-radicale2/luasrc/controller/radicale2.lua b/applications/luci-app-radicale2/luasrc/controller/radicale2.lua index 7b94552ed..f8aa553ec 100644 --- a/applications/luci-app-radicale2/luasrc/controller/radicale2.lua +++ b/applications/luci-app-radicale2/luasrc/controller/radicale2.lua @@ -12,6 +12,7 @@ function index() page = entry({"admin", "services", "radicale2"}, alias("admin", "services", "radicale2", "server"), _("Radicale 2.x")) page.leaf = false + page.acl_depends = { "luci-app-radicale2" } page = entry({"admin", "services", "radicale2", "server"}, cbi("radicale2/server"), _("Server Settings")) page.leaf = true diff --git a/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua b/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua index 22c75e4c8..1dbfd1d40 100644 --- a/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua +++ b/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua @@ -1,7 +1,7 @@ module("luci.controller.simple-adblock", package.seeall) function index() if nixio.fs.access("/etc/config/simple-adblock") then - entry({"admin", "services", "simple-adblock"}, cbi("simple-adblock"), _("Simple AdBlock")) + entry({"admin", "services", "simple-adblock"}, cbi("simple-adblock"), _("Simple AdBlock")).acl_depends = { "luci-app-simple-adblock" } entry({"admin", "services", "simple-adblock", "action"}, call("simple_adblock_action"), nil).leaf = true end end diff --git a/applications/luci-app-splash/luasrc/controller/splash/splash.lua b/applications/luci-app-splash/luasrc/controller/splash/splash.lua index af7a3a3c0..9fa47bf29 100644 --- a/applications/luci-app-splash/luasrc/controller/splash/splash.lua +++ b/applications/luci-app-splash/luasrc/controller/splash/splash.lua @@ -5,7 +5,7 @@ local util = require "luci.util" local ipc = require "luci.ip" function index() - entry({"admin", "services", "splash"}, cbi("splash/splash"), _("Client-Splash"), 90) + entry({"admin", "services", "splash"}, cbi("splash/splash"), _("Client-Splash"), 90).acl_depends = { "luci-app-splash" } entry({"admin", "services", "splash", "splashtext" }, form("splash/splashtext"), _("Splashtext"), 10) local e diff --git a/applications/luci-app-sqm/luasrc/controller/sqm.lua b/applications/luci-app-sqm/luasrc/controller/sqm.lua index 10e5fdbe6..3bf0af2de 100644 --- a/applications/luci-app-sqm/luasrc/controller/sqm.lua +++ b/applications/luci-app-sqm/luasrc/controller/sqm.lua @@ -23,4 +23,5 @@ function index() page = entry({"admin", "network", "sqm"}, cbi("sqm"), _("SQM QoS")) page.dependent = true + page.acl_depends = { "luci-app-sqm" } end diff --git a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua index b201abf14..fda9db16b 100644 --- a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua +++ b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua @@ -14,7 +14,11 @@ function index() if not nixio.fs.access("/etc/config/travelmate") then return end - entry({"admin", "services", "travelmate"}, firstchild(), _("Travelmate"), 40).dependent = false + + local e = entry({"admin", "services", "travelmate"}, firstchild(), _("Travelmate"), 40) + e.dependent = false + e.acl_depends = { "luci-app-travelmate" } + entry({"admin", "services", "travelmate", "tab_from_cbi"}, cbi("travelmate/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true entry({"admin", "services", "travelmate", "stations"}, template("travelmate/stations"), _("Wireless Stations"), 20).leaf = true entry({"admin", "services", "travelmate", "log"}, template("travelmate/logread"), _("View Logfile"), 30).leaf = true diff --git a/applications/luci-app-unbound/luasrc/controller/unbound.lua b/applications/luci-app-unbound/luasrc/controller/unbound.lua index 32879cb9f..f60feaa1f 100644 --- a/applications/luci-app-unbound/luasrc/controller/unbound.lua +++ b/applications/luci-app-unbound/luasrc/controller/unbound.lua @@ -18,8 +18,9 @@ function index() -- Expanded View - entry({"admin", "services", "unbound"}, - firstchild(), _("Recursive DNS")).dependent = false + local e = entry({"admin", "services", "unbound"}, firstchild(), _("Recursive DNS")) + e.dependent = false + e.acl_depends = { "luci-app-unbound" } -- UCI Tab(s) entry({"admin", "services", "unbound", "configure"}, diff --git a/applications/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua b/applications/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua index f4af659aa..d8393439c 100644 --- a/applications/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua +++ b/applications/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua @@ -1,7 +1,10 @@ module("luci.controller.vpn-policy-routing", package.seeall) function index() if nixio.fs.access("/etc/config/vpn-policy-routing") then - entry({"admin", "vpn"}, firstchild(), _("VPN"), 60).dependent=false + local e = entry({"admin", "vpn"}, firstchild(), _("VPN"), 60) + e.dependent = false + e.acl_depends = { "luci-app-vpn-policy-routing" } + entry({"admin", "vpn", "vpn-policy-routing"}, cbi("vpn-policy-routing"), _("VPN Policy Routing")) entry({"admin", "vpn", "vpn-policy-routing", "action"}, call("vpn_policy_routing_action"), nil).leaf = true end diff --git a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua index 77753020d..d5f4a8caf 100644 --- a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua +++ b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua @@ -1,7 +1,10 @@ module("luci.controller.vpnbypass", package.seeall) function index() if nixio.fs.access("/etc/config/vpnbypass") then - entry({"admin", "vpn"}, firstchild(), _("VPN"), 60).dependent=false + local e = entry({"admin", "vpn"}, firstchild(), _("VPN"), 60) + e.dependent = false + e.acl_depends = { "luci-app-vpnbypass" } + entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass")) entry({"admin", "vpn", "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true end diff --git a/applications/luci-app-wifischedule/luasrc/controller/wifischedule/wifi_schedule.lua b/applications/luci-app-wifischedule/luasrc/controller/wifischedule/wifi_schedule.lua index 261cf36d0..b61244a51 100644 --- a/applications/luci-app-wifischedule/luasrc/controller/wifischedule/wifi_schedule.lua +++ b/applications/luci-app-wifischedule/luasrc/controller/wifischedule/wifi_schedule.lua @@ -23,7 +23,11 @@ function index() if not nixio.fs.access("/etc/config/wifi_schedule") then return end - entry({"admin", "services", "wifi_schedule"}, firstchild(), _("Wifi Schedule"), 60).dependent=false + + local e = entry({"admin", "services", "wifi_schedule"}, firstchild(), _("Wifi Schedule"), 60) + e.acl_depends = { "luci-app-wifischedule" } + e.dependent = false + entry({"admin", "services", "wifi_schedule", "tab_from_cbi"}, cbi("wifischedule/wifi_schedule"), _("Schedule"), 1) entry({"admin", "services", "wifi_schedule", "wifi_schedule"}, call("wifi_schedule_log"), _("View Logfile"), 2) entry({"admin", "services", "wifi_schedule", "cronjob"}, call("view_crontab"), _("View Cron Jobs"), 3)