We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1>TestModule .java需加上一行代码,@authority(value="B001",desc="操作方法")
package org.nutz.authdemo.web.module;
import java.util.Date;
import org.nutz.extras.mvc.annotation.Authority; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok;
@at("/test") public class TestModule {
@At("/ping") @Ok("json") @Authority(value="B001",desc="操作方法") public String ping(){ return new Date().toString(); }
}
2>在用户登录完之后把该权限加进去 AuthDemoModule.java中修改如下。
@At("/login") @Ok("jsp:jsp.login") @Authority(value="A003",isDefault=true,desc="登录") public void login(HttpServletRequest req){ //添加权限到session中,登录后就可以访问 index 和 logout 了. //登录之后把访问/test/ping 的方法权限加进来 req.getSession().setAttribute("__AUTHORITY_STRING__", "A001;A002;B001;"); }
The text was updated successfully, but these errors were encountered:
哦,好
Sorry, something went wrong.
No branches or pull requests
1>TestModule .java需加上一行代码,@authority(value="B001",desc="操作方法")
package org.nutz.authdemo.web.module;
import java.util.Date;
import org.nutz.extras.mvc.annotation.Authority;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@at("/test")
public class TestModule {
}
2>在用户登录完之后把该权限加进去
AuthDemoModule.java中修改如下。
The text was updated successfully, but these errors were encountered: