roleAllow(UserRole::NORMAL_ADMIN); } protected function getParam(): IParam { return $this->param; } protected function run(Request $request): JsonResponse { $param = $this->param; $role = $this->loginUser()->user()->role; $currentContractId = $this->loginUser()->getCurrentContractId(); if (!$currentContractId && $role !== UserRole::SUPER_ADMIN) { throw new AppCommonException("認証不正"); } $condition = [ ...$param->toArray(), LoginUserRepository::CONDITION_CONTRACT_ID => $currentContractId, ]; if ($role === UserRole::NORMAL_ADMIN) { Arr::add($condition, LoginUserRepository::CONDITION_ID, $this->loginUser()->user()->id); } $list = $this->repository->get($condition); return $this->successResponse([ 'records' => $list ]); } }