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

import javax.inject.Inject;

import de.ivu.elect.business.dokumente.entity.DokumentVorlageMeta;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.menu.AbstractMenuItemEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

public abstract class AbstractDokumentVorlageMenuItemEntry extends AbstractMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient DokumentVorlageMeta dokumentVorlageMeta;

  public AbstractDokumentVorlageMenuItemEntry() {
    super();
  }

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

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

  protected abstract UseCasePermission getUseCasePermission();

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

  protected DokumentVorlageMeta getMeta() {
    return dokumentVorlageMeta;
  }
}
