How to disable/enable UI tab from UI


#1

hi
I want to disable / enable tabs in dependence on login. it is possible?

thanks


#2

Hi,
not currently - though @shrickus may be looking at a Pull Request that would allow disabling of tabs. Not sure how dynamic this would be and certainly not sure how it would tie into authentication given there is no user authentication support built in.


#3

I've added two new properties on the ui_tab node -- disabled and hidden. I seem to remember there was a msg-based way to toggle the "collapsed" property of a ui_group, but can't recall how. Dave, would that same mechanism work for these new properties? Is there any code that would need to be implemented to "look" for those types of msg?


#4

would need some changes to the ui-ui-control.js node to add the extra property(ies) and then also in main.js (around line 504) to grab them and do the right thing. Not sure it needs two properties as once disabled hide is redundant - so maybe just three states ?


#5

Thanks for doing some of my homework for me...

Actually, I planned on allowing a disabled "page" to show up as non-selectable (greyed-out? lined-through? banned icon?) on the Nav menu. That would be a nice way to let someone know that there are other parts of the dashboard available, but they don't have access to them right now (e.g. they need to input an access code first).


#6

Oh, that reminds me... I'm also thinking that disabled pages not have their source included in the dashboard SPA. I can't see a good reason why any of their embedded code (css, js) should reach the browser, and potentially mess with other pages' rendering or behavior.


#7

Oh. So disabled is just greyed out. Hidden is navigable but not in menu. So both would then be “really” not available ?


#8

Right -- if you want to pretend it does not exist then both need to be set to "true".


#9

yes. i want to show tabs after input password in keyboard tab and hidden keyboard tab


#10

it is actually protection against undesirable visitors. turn off the tabs I want, and then turn them on after I sign in.


#11

Sorry for bringing up an old thread, just wanted to ask:
this is currently not implemented, right?
I am looking for exactly the same functionality for "undesirable visitors", as Bambulko mentioned.


#12

Correct it's not yet implemented (though a basic PR is now in place so work has commenced)... BUT this is not really something I could recommend for security as the end urls will still be available to all as soon as anyone logs in.