<?php

namespace App\Helpers\Customer\Wallet;

use App\Helpers\Customer\CustomerHelper;


abstract class WalletHelper extends CustomerHelper
{
  protected function __construct()
  {
    parent::__construct();
  }

  public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
  {
    switch ($action) {
      case 'delete':
      case 'batchjob':
      case 'batchjob_delete':
        //역활이 보안관리자가 아니면 사용불가
        $action = $this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']]) ?  parent::getListButton($action, $label, $viewDatas, $extras) : "";
        break;
      case 'modify':
        //역활이 보안관리자가 아니면 수정불가
        $action = $this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']]) ? parent::getListButton($action, $label, $viewDatas, $extras) : $label;
        break;
      default:
        $action = parent::getListButton($action, $label, $viewDatas, $extras);
        break;
    }
    return $action;
  }
}
