feat: [payroll] 급여관리 페이지 접근 제한 (이름 기반)

- 허용 사용자: 이경호, 전진선, 김보곤
- 웹 컨트롤러: 미허용 시 안내 뷰 반환
- API 컨트롤러: 모든 엔드포인트에 403 반환
- restricted.blade.php 안내 페이지 생성
This commit is contained in:
김보곤
2026-02-27 17:59:50 +09:00
parent 732d021b6d
commit 53c7f00340
3 changed files with 90 additions and 1 deletions

View File

@@ -11,6 +11,8 @@
class PayrollController extends Controller
{
private const ALLOWED_PAYROLL_USERS = ['이경호', '전진선', '김보곤'];
public function __construct(
private PayrollService $payrollService
) {}
@@ -24,6 +26,10 @@ public function index(Request $request): View|Response
return response('', 200)->header('HX-Redirect', route('hr.payrolls.index'));
}
if (! in_array(auth()->user()->name, self::ALLOWED_PAYROLL_USERS)) {
return view('hr.payrolls.restricted');
}
$stats = $this->payrollService->getMonthlyStats();
$departments = $this->payrollService->getDepartments();
$employees = $this->payrollService->getActiveEmployees();