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
我想知道的一樣,但我們需要看到你的代碼和路由 –