src/main/java/org/jcasbin/plugins/JCasbinAuthzFilter.java
// If jCasbin denies the request, return HTTP 403 Forbidden.
If jCasbin denies the request, return HTTP 403 Forbidden.
If jCasbin denies the request return HTTP 403 Forbidden .
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
            throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        HttpServletResponse response = (HttpServletResponse) servletResponse;
        String user = getUser(request);
        String path = request.getRequestURI();
        String method = request.getMethod();
        System.out.println("(" + user + ", " + path + ", " + method + ")");
        if (enforcer.enforce(user, path, method)) {
            filterChain.doFilter(request, response);
        } else {
            response.setStatus(HttpServletResponse.SC_FORBIDDEN);
        }
    }
public void doFilter ( ServletRequest servletRequest , ServletResponse servletResponse , FilterChain filterChain ) throws IOException , ServletException { HttpServletRequest request = ( HttpServletRequest ) servletRequest ; HttpServletResponse response = ( HttpServletResponse ) servletResponse ; String user = getUser ( request ) ; String path = request . getRequestURI ( ) ; String method = request . getMethod ( ) ; System . out . println ( "(" + user + ", " + path + ", " + method + ")" ) ; if ( enforcer . enforce ( user , path , method ) ) { filterChain . doFilter ( request , response ) ; } else { response . setStatus ( HttpServletResponse . SC_FORBIDDEN ) ; } }
If jCasbin denies the request, return HTTP 403 Forbidden.
If jCasbin denies the request return HTTP 403 Forbidden .