jcasbin-jfinal-plugin is an authorization middleware for JFinal, it's based on https://github.com/casbin/jcasbin. It is developed under the latest JFinal 3.4 and Java 8.
<dependency> <groupId>org.casbin</groupId> <artifactId>jcasbin-jfinal-plugin</artifactId> <version>1.0.0</version> </dependency>
This project itself is a working JFinal project that integrates with jCasbin. The steps to use jCasbin in your own JFinal project are:
JCasbinAuthzInterceptor's String getUser(HttpServletRequest request) method to make sure jCasbin can get the authenticated user name.JCasbinAuthzInterceptor interceptor is loaded, so it can filter all your requests. To do this, you can use the following code in your XXXConfig class:public class DemoConfig extends JFinalConfig { public void configInterceptor(Interceptors me) { me.add(new JCasbinAuthzInterceptor()); } }
This project is under Apache 2.0 License. See the LICENSE file for the full license text.