JSP 中的 Spring Security - 单击不允许的操作
如果用户单击名称空间中的某个操作,而该角色用户现在没有任何反应。我可以拦截这个并将他重定向到某个异常吗?
示例:
<intercept-url pattern="/secure/project/**" access="ROLE_PROJECT"/>
<intercept-url pattern="/secure/statistics/**" access="ROLE_STATISTICS"/>
用户只有一个角色 - ROLE_PROJECT。开发人员(当然不是我:))会忘记在 /secure/statistics 中隐藏某个操作,因此该用户也会看到它。如何使用一些自定义结果处理对此操作的点击?
If user clicks on an action in namespace which role user hasn't now nothing happens. Can I intercept this and redirect him to some exception?
Example:
<intercept-url pattern="/secure/project/**" access="ROLE_PROJECT"/>
<intercept-url pattern="/secure/statistics/**" access="ROLE_STATISTICS"/>
User has only one role - ROLE_PROJECT. And the developer (not me, of course :)) will forget to hide an action in /secure/statistics, so also this user will see it. How to handle the click on this action with some custom result?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您的用例以及如何处理它已记录在案 此处 -
AccessDeniedHandler
I guess your use case and how to handle it is documented here -
AccessDeniedHandler