class MachineTokenAccessFilter extends CheMethodInvokerFilter {

  @Override
  protected void filter(GenericResourceMethod genericMethodResource, Object[] arguments)
      throws ForbiddenException {
    if (!(EnvironmentContext.getCurrent().getSubject() instanceof MachineTokenAuthorizedSubject)) {
      return;
    }
    if (!allowedMethodsByPath
        .get(genericMethodResource.getParentResource().getPathValue().getPath())
        .contains(genericMethodResource.getMethod().getName())) {
      throw new ForbiddenException("This operation cannot be performed using machine token.");
    }
  }

  @Inject public  MachineTokenAccessFilter(Set<MachineAuthenticatedResource> resources);

}