On Mon, Jun 22, 2009 at 2:11 PM, Paul Grenyer<[email protected]> wrote:
>
> Hi All
>
> My company are working on an enterprise application with GWT, Spring
> and Hibernate. We've successfully integrated Spring Security, Spring
> MVC and GWT, but we want to display menus and associated views based
> on role and are wondering the best way to do this.
>
> To give an example of what I mean, if a normal user logs in they're
> presented with the user's menu in the left hand panel. If an
> administrator logs in they're presented with the user's menu and the
> administrator's menu. We could of course make an RPC call after the
> user (or administrator) logs in and only display the relevant menus
> based on logic in the GWT code, but we'd prefer to move the logic and
> the code for that to the server side. Is there a way?
>
> Something else we'd like to do is have optional, at deploy time, menus
> and views. Is there a way we can "plugin" such things?


Hi Paul,

I have a similar situation for my project.  What I do is make the
first async call from onModuleLoad() do something like
'getPortalAttributes'.  This returns to me info from the server like:
is the user logged in; is the application in development mode; if the
user is logged in, what are their permissions.  From there I generate
menus based on the user's permissions, and configure things like the
GWT.UncaughtExceptionHandler.  Of course, your application shouldn't
trust any permissions logic that is applied on the client, but
determining what menus to show is harmless for me.

A different approach is to return the menu structure from the server
based on a users permissions.

-Dave

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to