class SpaceGuidBasedAuthorizationFilter implements UriAuthorizationFilter {

    @Override
    public final boolean ensureUserIsAuthorized(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String spaceGuid = extractAndLogSpaceGuid(request);
        try {
            authorizationChecker.ensureUserIsAuthorized(request, SecurityContextUtil.getUserInfo(), spaceGuid, null);
            return true;
        } catch (ResponseStatusException e) {
            logUnauthorizedRequest(request, e);
            response.sendError(e.getStatus()
                                .value(),
                               MessageFormat.format(Messages.NOT_AUTHORIZED_TO_OPERATE_IN_SPACE_WITH_GUID_0, spaceGuid));
            return false;
        }
    }

    public  SpaceGuidBasedAuthorizationFilter(AuthorizationChecker authorizationChecker);

}