feat: [payroll] 급여관리 페이지 접근 제한 (이름 기반)
- 허용 사용자: 이경호, 전진선, 김보곤 - 웹 컨트롤러: 미허용 시 안내 뷰 반환 - API 컨트롤러: 모든 엔드포인트에 403 반환 - restricted.blade.php 안내 페이지 생성
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user