class EndpointAdminOnlyAuthorizationFilter implements ContainerRequestFilter {

    @Override
    public void filter(ContainerRequestContext requestContext) throws IOException {

        int tenantId = VitamThreadUtils.getVitamSession().getTenantId();

        if (isAdminOnly && tenantId != VitamConfiguration.getAdminTenant()) {
            final VitamError vitamError = generateVitamError();
            requestContext.abortWith(
                Response.status(vitamError.getHttpCode()).entity(vitamError).type(MediaType.APPLICATION_JSON_TYPE)
                    .build());
        }
    }

    public  EndpointAdminOnlyAuthorizationFilter(boolean isAdminOnly);

}