PlaceChangeRequestEvent Interception

50 views
Skip to first unread message

Arash

unread,
Feb 19, 2012, 4:16:47 PM2/19/12
to Google Web Toolkit
I am trying to utilize the place framework for user authorization
based on the requested place and the user privileges. Let's say if
user is not allowed to be taken to Editing a profile, I want to send
him to the homepage. PlaceChangeRequestEvent seems to be a good
candidate to intercept the placeChangeEvent but it is only designed to
cancel the place change through the native ui dialog box presented to
the user not through the program flow.
I tried to send another placechange event inside the
placeChangRequestEvent handler but the application will end up where
it was supposed to go originally. This is expected because the goTo()
method in placeController is not done for the first request.
Now except the idea of letting the application go to the first place
and then send another placeChangeEvent through placeController.goTo()
method, Is there any proper/clean way to intercept a placeChangeEvent.

I appreciate any feedback / hint
Arash

Thomas Broyer

unread,
Feb 19, 2012, 5:15:25 PM2/19/12
to google-we...@googlegroups.com
You could treat the request place just as if it were the homepage place, without actually changing it (and/or changing it afterwards, to put it in sync with what you're displaying; rather than the other way around). If you're using activities, simply return the same activities you'd return for the homepage place from your ActivityMappers.

Arash

unread,
Feb 19, 2012, 6:52:59 PM2/19/12
to Google Web Toolkit
Thanks for the quick response. ActivityMapper sounds like a proper
point to implement authorization.
Reply all
Reply to author
Forward
0 new messages