Access Control for events

2009-06-25 Thread Moritz Gmelin

Hi,

I'm on T5.1.0.5.
I have installed 2 AccessControlDispatchers in my application. One for  
PageRendering and one for event handling. Both Dispatchers just  
redirect to the start page with an error message in the case that e.g.  
no user was logged in.

This works nicely with all pages and event links.
The problem is that AJAX calls also get intercepted and the response  
is obviousely the rendered StartPage. So for a click on an inPlace  
Table when the user was not logged in anymore, he gets a Blackbird- 
Console Popup with a not-so-user-friendly error message.


Does anyone have an idea about possible solutions to this?

Thanks

Moritz

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Access Control for events

2009-06-25 Thread donf yang
You  can have a component named Reporter with some javascript code, in your
ajax case, handle the event and record any helpful Block, return
MultiZoneUpdate(reporter.getZone(), reporter). So, you can control any
responses in this component, redirect to login page, display a error message
or pop a login panel by javascript

Reporter.java

public interface Reporter {

 public static final String PARAM_NAME = Reporter;

 public static final byte SUCCESS = 0x04;
 public static final byte INFO = 0x08;
 public static final byte WARN = 0x16;
 public static final byte ERROR = 0x32;

 public CollectionRecord getRecords();
 public void error(Object message);
 public void warn(Object message);
 public void info(Object message);

 public void success(Object message);
 public boolean hasRecord();
 public String getZone();
}


tml:

t:If test=block
div class=record-blockt:Delegate to=message //div
t:parameter name=else
 div class=record-messaget:RenderObject object=${message}
//div
/t:parameter
   /t:If


On Thu, Jun 25, 2009 at 2:41 PM, Moritz Gmelin moritz.gme...@gmx.de wrote:

 Hi,

 I'm on T5.1.0.5.
 I have installed 2 AccessControlDispatchers in my application. One for
 PageRendering and one for event handling. Both Dispatchers just redirect to
 the start page with an error message in the case that e.g. no user was
 logged in.
 This works nicely with all pages and event links.
 The problem is that AJAX calls also get intercepted and the response is
 obviousely the rendered StartPage. So for a click on an inPlace Table when
 the user was not logged in anymore, he gets a Blackbird-Console Popup with a
 not-so-user-friendly error message.

 Does anyone have an idea about possible solutions to this?

 Thanks

 Moritz

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




-- 

Regards,

Donf Yang
--
To be surprised,to wonder,is to begin to understand.


Re: Access Control for events

2009-06-25 Thread Moritz Gmelin

Hi,

I'm sorry but I don't understand the idea of your proposal.

This Reporter component should it be placed on every page? How will it  
intercept the AJAX communication between the inPlace Grid (or any  
other AJAX-using-component) and the server and therefore handle the  
response and finally forward the response to the inPlace Grid that is  
waiting for it?


Thanks for more insight.

Moritz

Am 25.06.2009 um 09:09 schrieb donf yang:

You  can have a component named Reporter with some javascript code,  
in your

ajax case, handle the event and record any helpful Block, return
MultiZoneUpdate(reporter.getZone(), reporter). So, you can control any
responses in this component, redirect to login page, display a error  
message

or pop a login panel by javascript

Reporter.java

public interface Reporter {

public static final String PARAM_NAME = Reporter;

public static final byte SUCCESS = 0x04;
public static final byte INFO = 0x08;
public static final byte WARN = 0x16;
public static final byte ERROR = 0x32;

public CollectionRecord getRecords();
public void error(Object message);
public void warn(Object message);
public void info(Object message);

public void success(Object message);
public boolean hasRecord();
public String getZone();
}


tml:

t:If test=block
   div class=record-blockt:Delegate to=message //div
   t:parameter name=else
div class=record-messaget:RenderObject object=${message}
//div
   /t:parameter
  /t:If


On Thu, Jun 25, 2009 at 2:41 PM, Moritz Gmelin  
moritz.gme...@gmx.de wrote:



Hi,

I'm on T5.1.0.5.
I have installed 2 AccessControlDispatchers in my application. One  
for
PageRendering and one for event handling. Both Dispatchers just  
redirect to
the start page with an error message in the case that e.g. no user  
was

logged in.
This works nicely with all pages and event links.
The problem is that AJAX calls also get intercepted and the  
response is
obviousely the rendered StartPage. So for a click on an inPlace  
Table when
the user was not logged in anymore, he gets a Blackbird-Console  
Popup with a

not-so-user-friendly error message.

Does anyone have an idea about possible solutions to this?

Thanks

Moritz

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org





--

Regards,

Donf Yang
--
To be surprised,to wonder,is to begin to understand.



-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org