2
我在Controller中使用@Check注释进行了操作。@从其他操作调用操作时,检查不起作用
@With(Secure.class)
public class Application extends Controller {
@Check("admin")
public static void securedMethod() {
//secured code
}
当我从浏览器调用此操作时,它会从Security类调用布尔检查(字符串配置文件)。但是当我从另一个动作调用此动作时:
Application.securedMethod();
它只是调用安全代码,省略Security.check()调用。我想,@Check不应该允许执行securedMethod(),除非Security.check()返回true。任何想法我怎么能让它表现得像这样?
但为什么没有重定向?如果我的[描述](http://stackoverflow.com/questions/3899670/how-can-i-influence-the-redirect-behavior-in-a-play-controller)是正确的应该有一个重定向,所以一个新的请求。 – niels
我想知道的一样,但我们需要看到你的代码和路由 –