I have a dashboard for an application. Few tabs / Groups need to be accessed by "Manager" Role ONLY while other should be visible / accessible to all roles. I created a flow where I can create this option using the "ui-control node". But I have got an issue. If Manager Role is logged in and does not log out during exit, then any one else accessing the dashboard, on same / different computer, can access all tabs / groups which are assigned for Manage role.
I want your help if any one has worked on such problem already and know any solution for this issue . My flow is given as below:
[
{
"id": "4c8d12aa.533cbc",
"type": "ui_ui_control",
"z": "e3742b89.114eb8",
"name": "",
"events": "all",
"x": 620,
"y": 1020,
"wires": [
[]
]
},
{
"id": "a9948f71.47707",
"type": "inject",
"z": "e3742b89.114eb8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 210,
"y": 1020,
"wires": [
[
"e9fcb881.c69c08"
]
]
},
{
"id": "e9fcb881.c69c08",
"type": "function",
"z": "e3742b89.114eb8",
"name": "Manager",
"func": "var user = global.get('currentuser');\n\nif(user != \"Manager\")\n{\nmsg.payload =\n{\n \"tabs\": {\n \"hide\": \"User_Inputs\"\n \n }\n}\nreturn msg;\n}\n\nif(user == \"Manager\")\n{\nmsg.payload =\n{\n \"tabs\": {\n \"show\": \"User_Inputs\"\n \n }\n}\nreturn msg;\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 1020,
"wires": [
[
"4c8d12aa.533cbc"
]
]
}
]