class AuthorizationFilter implements ContainerRequestFilter {

    public static final String PROJECTS_PARAM = "projects[]";

    private final RuntimeEnvironment env = RuntimeEnvironment.getInstance();

    @Context
    private HttpServletRequest request;

    /**
     * Checks if the request contains {@link #PROJECTS_PARAM} and if so then checks if the user has access to the
     * specified projects.
     * @param context request context
     */
    @Override
    public void filter(final ContainerRequestContext context) {<FILL_FUNCTION_BODY>}

}

        if (request == null) { // happens in tests
            return;
        }
        AuthorizationFramework auth = env.getAuthorizationFramework();
        if (auth != null) {
            String[] projects = request.getParameterValues(PROJECTS_PARAM);
            if (projects != null) {
                for (String project : projects) {
                    Project p = Project.getByName(project);
                    if (!auth.isAllowed(request, p)) {
                        context.abortWith(Response.status(Response.Status.FORBIDDEN).build());
                    }
                }
            }
        }
    
<no_super_class>