Cakephp ACL redirect when a user has insufficient

2019-08-10 03:42发布

First you should be aware that I am a new cake convert.

Ok, from what I can tell when a user try's to visit a url they do not have sufficient privileges for, the ACL redirects them to "/" if Auth has loged them in, and login if the user is not already loged in. Also Auth remembers the requested page and on a successful login will attempt to redirect you there, again if you do not have sufficient privileges ACL redirects the user to "/". My question is when the ACL detects that the user does not have the necessary privileges, is there an event or a callback I can catch so I can choose where the user is redirected based on what type of user they are etc. In this particular case I'm using group based permissions and prefix routing.

Thanks.

标签: cakephp-1.3
1条回答
戒情不戒烟
2楼-- · 2019-08-10 04:18

You could check for permissions and do the redirect in the beforeFilter() method of your controller or in the AppController if this logic is shared by all of your controllers.

查看更多
登录 后发表回答