From 4ea441de2dde5fdfe0daf3f42099dd050145692e Mon Sep 17 00:00:00 2001 From: koreacomp5 Date: Thu, 9 Oct 2025 14:52:52 +0900 Subject: [PATCH] =?UTF-8?q?2.5=20=EA=B6=8C=ED=95=9C=20=EA=B8=B0=EB=B0=98?= =?UTF-8?q?=20UI=20=EB=85=B8=EC=B6=9C=20=EC=A0=9C=EC=96=B4(=EB=B9=A0?= =?UTF-8?q?=EB=A5=B8=20=EC=95=A1=EC=85=98/=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=EB=A9=94=EB=89=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/QuickActions.tsx | 16 ++++++++++++++++ src/app/page.tsx | 4 +++- todolist.txt | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/app/components/QuickActions.tsx diff --git a/src/app/components/QuickActions.tsx b/src/app/components/QuickActions.tsx new file mode 100644 index 0000000..6824a99 --- /dev/null +++ b/src/app/components/QuickActions.tsx @@ -0,0 +1,16 @@ +"use client"; +import { usePermission } from "@/lib/usePermission"; + +export function QuickActions() { + const { can } = usePermission(); + const canWrite = can("POST", "CREATE"); + const isAdmin = can("ADMIN", "ADMINISTER") || can("BOARD", "MODERATE"); + return ( +
+ {canWrite && } + {isAdmin && } +
+ ); +} + + diff --git a/src/app/page.tsx b/src/app/page.tsx index 0b7153b..705ce97 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,8 +1,10 @@ import Image from "next/image"; +import { QuickActions } from "@/app/components/QuickActions"; export default function Home() { return ( -
+
+
); } diff --git a/todolist.txt b/todolist.txt index 9935e20..272563d 100644 --- a/todolist.txt +++ b/todolist.txt @@ -10,7 +10,7 @@ 2.2 권한 enum/매핑 정의(리소스/액션) o 2.3 서버 권한 미들웨어 적용(API 보호 라우트 지정) o 2.4 페이지/컴포넌트 가드 훅 구현(usePermission) o -2.5 권한 기반 UI 노출 제어(빠른 액션/관리자 메뉴) +2.5 권한 기반 UI 노출 제어(빠른 액션/관리자 메뉴) o [로그인/인증] 3.1 로그인/가입 폼 검증(Zod) 및 오류 UX