开发者

Grails Acegi : Redirection on a ajax method and not on the webpage. Why?

I use Acegi with grails but I have a problem with a redirection.

I define i开发者_高级运维n UrlMapping this :

"/" { 
  controller = "mycontroller"
  action = "myaction"
}

In mycontroller :

myaction = {
    if (authenticateService.isLoggedIn(){ "/mycontext/public" }
    else {
       // pseudo code
       if (role = ROLE_1) {
           redirect "/mycontext/myactionforNormalUser"
       }
       else if (role = ROLE_ADMIN) {
           redirect "/mycontext/myactionforROLEADMIN"
       }
    }
}

IfI go to my app without login, I'm redirected to the public page, so it's right. But on login on admin, I'm redirected to the auth/deniedAjax (of acegi) and not on my page. And if I login as a normal user, I'm redirect on a ajax method define in my gsp.

Do you have an idea ?

Thanks a lot.


Upgraded and working fine now with spring security

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜