AJAX - ACL redirection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

AJAX - ACL redirection

shadow762
This post has NOT been accepted by the mailing list yet.
Hi,

By default, the Auth component used with the ACL component redirects
the user to the referer when this one can't access to the controller/
action (last lines of method startup in auth component):

                if ($this->isAuthorized($type)) {
                        return true;
                }

                $this->Session->setFlash($this->authError, $this->flashElement,
array(), 'auth');
                $controller->redirect($controller->referer(), null, true);
                return false;

This is ok when you make a classic HTTP query but what about an AJAX
query? In my case, I don't want to display a complete page in my AJAX
dialog but only a message alerting the user that he can't access to
the page.

Any idea to manage that or if a  solution already exists?

Thanks