package de.ivu.elect.business.security.control;

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Predicate;

import javax.enterprise.inject.Specializes;

import de.ivu.elect.business.security.UseCasePermission;

@Specializes
public class NlWasElectExtendedUseCasePermissionFilter extends NlElectExtendedUseCasePermissionFilter {

  private static final long serialVersionUID = 1L;

  public static final AtomicBoolean SHUTDOWN = new AtomicBoolean(false);

  @Override
  protected <T> boolean test(UseCasePermission useCasePermission, T object, Predicate<T> bestimme) {
    return !SHUTDOWN.get() && super.test(useCasePermission, object, bestimme);
  }
}
