package com.inkasso.auth.config;

import com.inkasso.auth.scanner.PermissionScanner;
import com.inkasso.factoring.system.permission.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;

public class PermissionInit implements CommandLineRunner {

  @Autowired
  private PermissionService permissionService;

  @Override
  public void run(String... args) throws Exception {
    permissionService.saveBatch(PermissionScanner.getPermissionList());
  }
}
