fix(core,admin_basic,board,ecommerce,page,gdpr,verification): 설정 미러·자동 정리·탈퇴 원자성·일괄 선택 범위 정비
공개이슈 ··· 및 그 전수 해소분. - 설정 저장·복원·초기화가 상주 프로세스 미러를 갱신하도록 단일 소유자화 - 만료 데이터 자동 정리 예약 12종 신설, 파기는 기본키 배치로 분할 - 회원 탈퇴를 전 경로 원자화하고 관리자 상태변경 경로를 정식 탈퇴로 통일 - 일괄 처리 목록의 선택을 화면에 보이는 행으로 한정(selectionScope) - 비밀번호 정책 문구를 도메인 중립 라벨로 정정 - 정적 검사 2종·검증 스킬 설계 정합성 축 신설
This commit is contained in:
1 parent
49c155509e
commit
4e1ec6e001
136 files changed
+7016
-504
No files matched your search
@@ -11,6 +11,7 @@ use App\Models\User;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RoleService
|
||||
@@ -183,16 +184,20 @@ class RoleService
|
||||
throw new ExtensionOwnedRoleDeleteException;
|
||||
}
|
||||
|
||||
// 훅: 삭제 전
|
||||
HookManager::doAction('core.role.before_delete', $role);
|
||||
// 관계 해제 후 삭제가 실패하면 그 역할을 가진 사용자 전원이 권한만 잃고
|
||||
// 역할은 그대로 남는다. 전 단계를 하나로 묶는다.
|
||||
$result = DB::transaction(function () use ($role) {
|
||||
// 훅: 삭제 전
|
||||
HookManager::doAction('core.role.before_delete', $role);
|
||||
|
||||
// 관계 해제 (명시적 삭제 - CASCADE 의존 금지)
|
||||
$this->roleRepository->detachAllPermissions($role);
|
||||
$role->menus()->detach();
|
||||
$role->users()->detach();
|
||||
// 관계 해제 (명시적 삭제 - CASCADE 의존 금지)
|
||||
$this->roleRepository->detachAllPermissions($role);
|
||||
$role->menus()->detach();
|
||||
$role->users()->detach();
|
||||
|
||||
// 역할 삭제
|
||||
$result = $this->roleRepository->delete($role);
|
||||
// 역할 삭제
|
||||
return $this->roleRepository->delete($role);
|
||||
});
|
||||
|
||||
// 훅: 삭제 후
|
||||
HookManager::doAction('core.role.after_delete', $role->id);
|
||||
|
||||
Reference in new issue
Block a user