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

import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.business.benutzerverwaltung.entity.Rolle;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.benutzerverwaltung.RolleEditView;

@Named(RolleEditAction.COMPONENT_NAME)
public class RolleEditAction extends AbstractRolleAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "rolleEditAction";

  @View
  @Inject
  private RolleEditView rolleEditView;

  public RolleEditAction() {
    super();
  }

  @Override
  protected UseCasePermission getRequiredPermission() {
    return UseCasePermission.ROLLE_EDIT;
  }

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

  @Override
  protected String doIt(Rolle rolle) {
    return rolleEditView.edit(rolle);
  }

  @Override
  protected boolean isFireChangeEvent() {
    return false;
  }

  @Override
  public String getLabelKey() {
    return "entity.edit.action.edit";
  }

  @Override
  public String getIcon() {
    return appIcons.getIconEdit();
  }
}
