applications: add ACL dependency annotations to legacy controllers
authorJo-Philipp Wich <jo@mein.io>
Sun, 19 Apr 2020 15:14:58 +0000 (17:14 +0200)
committerJo-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>
30 files changed:
applications/luci-app-adblock/luasrc/controller/adblock.lua
applications/luci-app-ahcp/luasrc/controller/ahcp.lua
applications/luci-app-aria2/luasrc/controller/aria2.lua
applications/luci-app-banip/luasrc/controller/banip.lua
applications/luci-app-commands/luasrc/controller/commands.lua
applications/luci-app-cshark/luasrc/controller/cshark.lua
applications/luci-app-dawn/luasrc/controller/dawn.lua
applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua
applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua
applications/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua
applications/luci-app-lxc/luasrc/controller/lxc.lua
applications/luci-app-mwan3/luasrc/controller/mwan3.lua
applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua
applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua
applications/luci-app-ocserv/luasrc/controller/ocserv.lua
applications/luci-app-olsr/luasrc/controller/olsr.lua
applications/luci-app-olsr/luasrc/controller/olsr4.lua
applications/luci-app-olsr/luasrc/controller/olsr6.lua
applications/luci-app-openvpn/luasrc/controller/openvpn.lua
applications/luci-app-privoxy/luasrc/controller/privoxy.lua
applications/luci-app-radicale/luasrc/controller/radicale.lua
applications/luci-app-radicale2/luasrc/controller/radicale2.lua
applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua
applications/luci-app-splash/luasrc/controller/splash/splash.lua
applications/luci-app-sqm/luasrc/controller/sqm.lua
applications/luci-app-travelmate/luasrc/controller/travelmate.lua
applications/luci-app-unbound/luasrc/controller/unbound.lua
applications/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua
applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
applications/luci-app-wifischedule/luasrc/controller/wifischedule/wifi_schedule.lua

index 11a4abb9f63442e22dd42c11d6649d520b6d8218..cef875bbb0b901a6c5b35bd2f51712728760e0f2 100644 (file)
@@ -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)
index e97da558b5e9287eed346d5754c14da50bebd8ca..afae5971d2231a49025e3b8c6289e0df1cd94e37 100644 (file)
@@ -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
 
index 4891727a08f9cce0e6b9ed53a717cf9a1796696b..52d7c94ebb66f650422114efe65bd99a4ff12c9d 100644 (file)
@@ -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)
index 6ada1d51672d8fc67f92fe1f9e39691685a60142..1befbe9867598eaebdb147b31e45e4fd8bd9a756 100644 (file)
@@ -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
index 433dfa14a0bfe85082102110456efece7aaa4fe2..f6227c6e4ec7112d82fceccb4fdb13f665f2621a 100644 (file)
@@ -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
index 43410a0045684f0ca90ac1d40c801dd2e6532dd1..a5812a6519ad4e87fc7f1a6418ff238a503297e6 100644 (file)
@@ -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
 
index 64055b4af372618496e9355d982c6ff364adafe0..6ba53f13d4a8a202dbfd6751f651302e1d839e41 100644 (file)
@@ -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)
index c0559452521731e60dfdce030d1437d16dc90d2b..a5d64265f37b7d5328b6b2d1cb5f9e5eb34788b1 100644 (file)
@@ -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)
index d236feae0a8cc0294aaed8186900aebea6646ba3..9ab5418492195205d1f60d8071fd38c0efa46600 100644 (file)
@@ -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
index 46c7684015dd874263984893bff8d22f5bb8c935..f8518c4d7e2bb3e57667e1fb907d41a7dece25b4 100644 (file)
@@ -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)
index 9432110104189c451c87a84e85e83cf91198f201..6fa1add0f8cab71f3392ff9d13061a706660ade1 100644 (file)
@@ -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()
index 35385912ceecfbe027c45f1dca42156ac2cc4693..1fb9083a53c1a4ca639c8bb9b0ed711abdad008f 100644 (file)
@@ -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"),
index 4d0527e33f85d679947902263210a723e38d3bb2..899e41a7ffc53084644dc250e74b35277457f0ac 100644 (file)
@@ -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)
index 0d15bea6488175a5837d9f185dd464101247c7ad..2b6490d33281f53161cbad873923f269aff6750d 100644 (file)
@@ -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)
index f41b4810380dd9c7849d9861574b886acee24a7c..3127f73c62e7e84df792f81c01b1b9fc5efb0f0e 100644 (file)
@@ -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"),
index 22d9a01f159a7268540a701ded0b8041281ad3df..41897092f706ca414d7a22abb6d4cbbb96ce7249 100644 (file)
@@ -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()
index 31a3101bc2f10dfec577f5d9b2fdf89fade5c405..5c6d887cb2c5defc2abd53ccca299c2f371091f3 100644 (file)
@@ -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"},
index 9fbaa0427b2ebd41af7d228c5fa896de819aef35..d09ad3398cc2815fa314b9aa28f655f58c893a2a 100644 (file)
@@ -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"},
index 55c29d1c2ac29c14534a95b09cef47d6307e2b34..2d57e8d3ad8b2a4c258831682ad07d8573be2c04 100644 (file)
@@ -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
index 6439a30c3f2b8a626bf19c9bb378358dcf42fa37..808ddbb447bb607e535332a0fe8a50d03d780877 100644 (file)
@@ -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
index 0be433a48d6b364a3415d3d090688a9189a52bb3..291f1b4dccac37d5bb1269bd13947d2ebad879d3 100644 (file)
@@ -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
index 7b94552ed6785978df5b8967a3390e261d70eb31..f8aa553ecb022d6f56a27514b09afb3e604eb8ee 100644 (file)
@@ -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
index 22c75e4c81f28032a9bd63ff4357175204bbfeda..1dbfd1d40cfbb4175768d25171d098cd59639f26 100644 (file)
@@ -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
index af7a3a3c0185f23ad3578f188686f406437f7165..9fa47bf2989a7070c780a30413d7f0d646517a08 100644 (file)
@@ -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
index 10e5fdbe6e88f4d80e23b8dec6764e5b4e166ba6..3bf0af2debf3eda689fdde2fce69265512f54278 100644 (file)
@@ -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
index b201abf14d9e9631827e47867de71b9b3721304d..fda9db16b26ac1c7b45297d0f31d7678f53fe6d0 100644 (file)
@@ -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
index 32879cb9f29e574eaaa914e44cf153c87eff7409..f60feaa1fb300407f31089b45aa1ef204fd199b3 100644 (file)
@@ -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"},
index f4af659aad41d4bd3910f6e50abb5c12f23e4f96..d8393439c17c70a5de971cec83798622c0463b5e 100644 (file)
@@ -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
index 77753020d00029510697c95ef84e1ab102b4191c..d5f4a8cafd7cefeedfcf5042ef74f0324bd37c8e 100644 (file)
@@ -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
index 261cf36d0f47b74e9dcb91e569dab00117dbc1f5..b61244a519ac10c6c2ad0afa0ae042b434f933ff 100644 (file)
@@ -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)