I'm developing a GWT-Application where the navigation is mainly a TabLayoutPane, where each Tab represents a different functionality. What I need is to only show tabs the user is allowed to see (each user has a role like user or admin).
The problem is I don't know how to achieve this, especially with UIBinder.
Here's what I thought of:
Or are there better ways to achieve something like this?
I would go with approach number one as it is much cleaner, imho. However, make sure that you don't use it as security feature and don't show any sensitive information that non admin is not allowed to see. Since all construction will occur in javascript in the browser, it will be fairly simple to fool browser into showing admin tabs without appropriate authorization.