fix:영업권 삭제 권한을 admin으로 제한
- 뷰에서 삭제 버튼 admin만 표시 - 컨트롤러에서 삭제 권한 체크 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user