Thursday, 22 August 2013

OpenWrt: LuCI: how to implement limited user access

OpenWrt: LuCI: how to implement limited user access

Goal: two users root and user. Root can access everything via
web-interface, but user should see only some parts of the menus.
One option would be to pass "sysauth" option to every module in question.
That is not very practical, because the user would see every menu entry
and would get login page for every menu he is not allowed to.
My idea is to figure out who is logged on and then do nothing in the
index() function of each restricted module. So far I couldn't find such a
function in LuCI API (http://luci.subsignal.org/api/luci/), that would
return a current logged user.
I know how to add additional users in OpenWrt/LuCI
(https://forum.openwrt.org/viewtopic.php?pid=163013#p163013). But it is
only a part of the solution.
Any idea, how to achieve my goal?

No comments:

Post a Comment