docs: add project docs and test updates

This commit is contained in:
taekyoungc
2026-04-08 00:23:55 +09:00
parent 06fedc866a
commit 06aa401048
238 changed files with 8373 additions and 148 deletions

View File

@@ -0,0 +1,16 @@
# 관리자단 — 필터
## AdminAuthFilter
- **파일**: `app/Filters/AdminAuthFilter.php`
- **등록**: `app/Config/Filters.php``'adminAuth' => \App\Filters\AdminAuthFilter::class`
### 동작
1. **로그인 여부**: `session()->get('logged_in')`이 없으면 → `site_url('login')`으로 리다이렉트, 플래시 `error` "로그인이 필요합니다."
2. **권한**: `session()->get('mb_level')`**3**(`Roles::LEVEL_LOCAL_ADMIN`) 또는 **4**(`Roles::LEVEL_SUPER_ADMIN`)이 아니면 → `site_url('/')`로 리다이렉트, 플래시 `error` "관리자만 접근할 수 있습니다."
3. 통과 시 `before()``null` 반환하여 다음 처리 진행.
### 적용 범위
- `app/Config/Routes.php``admin` 그룹 전체에 `'filter' => 'adminAuth'`로 적용됨.