fix:영업권 삭제 권한을 admin으로 제한

- 뷰에서 삭제 버튼 admin만 표시
- 컨트롤러에서 삭제 권한 체크 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-02 16:58:30 +09:00
parent 8574a9116f
commit 8303f6fd40
2 changed files with 6 additions and 3 deletions

View File

@@ -171,9 +171,10 @@ public function destroy(int $id)
->with('error', '이미 테넌트로 전환된 영업권은 삭제할 수 없습니다.');
}
// 본인 또는 관리자만 삭제 가능
if ($prospect->registered_by !== auth()->id()) {
// TODO: 관리자 권한 체크 추가
// 관리자만 삭제 가능
if (!auth()->user()->isAdmin()) {
return redirect()->route('sales.prospects.index')
->with('error', '삭제 권한이 없습니다. 본사 운영팀에 문의하세요.');
}
$prospect->delete();