package de.ivu.elect.presentation.exchange.action;

import javax.annotation.Nonnull;
import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import de.ivu.elect.business.datei.entity.DateiImport;
import de.ivu.elect.presentation.replikation.ReplikationPresentationStatus;

/**
 *  on 25.07.2017.
 */
@Specializes
public class WasDateiImportImportBestaetigenAction extends DateiImportImportBestaetigenAction {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient ReplikationPresentationStatus replikationPresentationStatus;

  @Override
  public boolean isDisabledInternal(@Nonnull DateiImport entity) {
    return super.isDisabledInternal(entity) || isSlave();
  }

  // WASDE-1153
  private boolean isSlave() {
    return replikationPresentationStatus.isSlave();
  }
}
