English 中文(简体)
定制标志
原标题:Customise Login Page Based on Required Roles with Grails Spring Security

我有2克铁路,有1.2.6个金矿。 我有不同页,有不同角色的@Secured annotation(ROLE_USER and ROLE_ADMIN)。 这一工程,但当我试图进入用户或管理安全网页时,我被转往同一个标识页。 我更希望把这一标识页与要求发挥的作用相适应。

例如,如果一个未经认证的用户试图查阅网页ROLE_USER,我将与用户标识页链接,但如果他们试图查阅网页ROLE_ADMIN,则不应使用。

是否有办法利用在日志网页上要求发挥的作用,或另选用一种办法,为某一URL编制一份角色清单?

问题回答

为了使用两个不同的标识页,你必须制作一个定制网站AuthenticationEnPointtry。 已在SO:上树立了一个榜样。 Grails项目的不同标识控制器,有春季安全

根据用户扮演的角色,创建自己的习俗SuccessHandler<>/strong>,并根据用户向另一页寄送他们的作用,将用户送往另一处。

http://omarello.com/09/grails-custom-target-urls- subsequently-login/“rel=“nofollow noreferer”>alink 至I发现的博客站。

希望会有所帮助。





相关问题
grails + gwt request handling via controllers

I am new to gwt. I am trying to integrate gwt+grails.Can anybody provide me a good example for handling the request using grails controllers and not a custom servlet.I will be really thankful if ...

Error loading the grails gwt module xml

I ve installed the plugin from this article by Peter http://www.cacoethes.co.uk/blog/groovyandgrails/the-command-pattern-w.... While compile time its not able to find the module file which is present ...

Sorting Objects Based on Custom Domain Class Methods

I have a domain class, in which I ve defined some methods which give the object a score based on different algorithms (eg. popularity). I now want to retrieve a list of these objects sorted by one of ...

Grails Packaging and Naming Conventions

Packaging Controllers, Services,etc. i.e. - com.company.controllers - com.company.services Is this a good practice or should be avoided by all means?? Another worth mentioning problem I encountered ...

Hibernate/GORM: collection was not processed by flush()

I have an integration test in my Grails application that fails when I try to save an entity of type Member invitingMember.save(flush: true) This raises the following exception org.hibernate....