neo09 / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

Consider a PlaceManager.revealUnauthorizedPlace called when the user navigates to an unrevealable page #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now, revealErrorPlace doesn't distinguish between a completely bogus 
name token and a valid name token that points to an invalid (secured) place. 
We could add a revealUnauthorizedPlace method that would be called whenever 
this happens. By default, the method would fallback to revealErrorPlace.

Original issue reported on code.google.com by philippe.beaudoin on 6 May 2010 at 4:25

GoogleCodeExporter commented 9 years ago

Original comment by goudreau...@gmail.com on 26 May 2010 at 7:54

GoogleCodeExporter commented 9 years ago

Original comment by goudreau...@gmail.com on 27 May 2010 at 4:09

GoogleCodeExporter commented 9 years ago

Original comment by goudreau...@gmail.com on 27 May 2010 at 5:36

GoogleCodeExporter commented 9 years ago
There may be loose of information:
- in PlaceManagerImpl, the revelErrorPlace is called with "request.toString()" 
as the
argument
- in ProxyPlaceAbstract, reavealUnauthorizedPlace is called with 
"request.getNameToken"

May be changing both to request and so the both method will take a PlaceRequest.

Original comment by olivier....@free.fr on 3 Jun 2010 at 9:14

GoogleCodeExporter commented 9 years ago
So, you're proposing to give the complete PlaceRequest as an argument ?

Else, there's a reason for that behavior. 

Reveal error place take the Parameters into consideration while 
revealUnauthorizedPlace only tell which place was unauthorized.

But I kinda love your idea of giving the complete PlaceRequest in fault and 
give the 
user the choice on how to use it.

Original comment by goudreau...@gmail.com on 3 Jun 2010 at 11:38

GoogleCodeExporter commented 9 years ago
Yes, I propose to give the PlaceRequest. You've build it so why not. If someone 
need
the parameters, he will build a PlaceRequest from the token.

For revealErrorPlace, you build a PlaceRequest from String, transform it to 
String,
call revealErrorPlace with the String. If I need a PlaceRequest, I transform the
String to a PlaceRequest... It's just like we love to do things again and again 
;).

For revealUnhautorizedPlace, I'm not sure about the parameters but there's a
consistency problem. The default revealUnhautorizedPlace call revealErrorPlace, 
so
sometimes revealErrorPlace have the full token, sometimes not...

Original comment by olivier....@free.fr on 3 Jun 2010 at 1:58

GoogleCodeExporter commented 9 years ago
Right. (Didn't think this morning about the case where only revealErrorPlace 
was overwritten. The real default 
behavior doesn't use the string at all and reveal defaultPlace.)

I'll open a new issue. 

Original comment by goudreau...@gmail.com on 3 Jun 2010 at 2:04

GoogleCodeExporter commented 9 years ago
What if the history token can't be parsed into a PlaceRequest? I think we catch 
an exception in this case  
and so have no placerequest? Should we pass both the string and placerequest?

Original comment by philippe.beaudoin on 3 Jun 2010 at 2:29

GoogleCodeExporter commented 9 years ago
I came across this while working on issue 108 and seriously, I doubt that this 
exception is useful. The only case 
where this exception would be thrown is when historyToken.split( 
HIERARCHY_PATTERN ); fail... so if REGEX 
syntax is invalid... and that's a private final static constant... or if 
HistoryToken is null... but then, even passing 
the string would be for nothing.

What I've done, is to return an empty PlaceRequest instead.

I'm ready to review issue 108 btw.

Original comment by goudreau...@gmail.com on 3 Jun 2010 at 2:50

GoogleCodeExporter commented 9 years ago
BTW, in updateHistory and onPlaceChanged you simply return nothing for that 
exception.

Original comment by goudreau...@gmail.com on 3 Jun 2010 at 2:51

GoogleCodeExporter commented 9 years ago
Ok sorry, forget what I said about the exception.

In kinda stepped over toPlaceRequest.

Original comment by goudreau...@gmail.com on 3 Jun 2010 at 2:57