package de.ivu.elect.presentation.email.menu;

import de.ivu.elect.business.email.entity.EmailVorgangMeta;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.menu.AbstractMenuItemEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

import javax.inject.Inject;

public abstract class AbstractEmailVorgangMenuItemEntry extends AbstractMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private EmailVorgangMeta emailVorgangMeta;

  public AbstractEmailVorgangMenuItemEntry() {
    super();
  }

  @Override
  protected AbstractGebietSecurity getGebietSecurity() {
    return KEINE_GEBIET_SECURITY;
  }

  @Override
  public boolean isRendered() {
    return hasUseCasePermission(getUseCasePermission());
  }

  protected abstract UseCasePermission getUseCasePermission();

  @Override
  public boolean isDisabledInternal() {
    return false;
  }

  protected EmailVorgangMeta getMeta() {
    return emailVorgangMeta;
  }
}
