创建新的春天注解 [英] create new spring annotation

查看:152
本文介绍了创建新的春天注解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发展春天有控制器很多方法的应用程序,并映射到不同的URL中使用@RequestMapping。

I'm developing an application in Spring which has numerous methods in the controller, and are mapped to various URL using @RequestMapping.

其中的一些方法(因此URL)是可访问的某些用户的角色,而不是其他人。我可以创建注释,所以只有特权用户访问正确的方法诠释这些方法,而不是其他人呢?

Some of these methods (and hence url) are accessible to some user roles, and not to others. Can I create annotations, and annotate these methods so that only privileged users have access to right methods, while not to the others?

先谢谢了。

推荐答案

您可以使用Spring Security和它的注解,限制访问的一些方法。这博客文章显示与使用注释的一些特性春季安全3。

You can use Spring Security and its annotations, restrict access to some methods. This Blog post show some features of annotations used with Spring Security 3.

看一看这个问题,并回答,就看你如何建立你自己的注解春天的安全性的。

Have a look at this question and answer, to see how you build your own annotations on top of spring security.

另请参见<一个文档href=\"http://static.springsource.org/spring-security/site/docs/3.1.x/reference/springsecurity-single.html#el-access\"相对=nofollow> Spring Security的3.1,前章pression的访问控制。

这篇关于创建新的春天注解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆