diff --git a/.atp/work-session/20260724-092601/report.md b/.atp/work-session/20260724-092601/report.md new file mode 100644 index 0000000..3252bf1 --- /dev/null +++ b/.atp/work-session/20260724-092601/report.md @@ -0,0 +1,57 @@ +# Work Session Report + +schema_version: 2 +sid: 20260724-092601 +started_at: 2026-07-24T09:26:01+09:00 +user_request: "포스팅은 권한있는 사람만 작성 가능한거니까 글쓰기는 권한있는 사람만 나타나게해줘" + +# Advisor Invocation Decision Log +# 각 advisor 호출/스킵 판단 즉시 1줄 append +- advisor: requirements-advisor + decision: skip + rationale: '요구 명확 — 기존 POST_WRITE 서버측 게이트를 뷰에 그대로 반영하는 단순 UI 노출 조건' + checked_at: 2026-07-24T09:26:01+09:00 +- advisor: research-advisor + decision: skip + rationale: 'PostController.requireWritePermission/gate.has(session, PermissionKeys.POST_WRITE) 기존 코드로 충분 — 신규 조사 불필요' + checked_at: 2026-07-24T09:26:01+09:00 +- advisor: design-advisor + decision: skip + rationale: '영향 파일 3개(PostController.java, posts-list.jsp, posts-empty.jspf) 확정, 계약(canWrite model attr) 자명 — 마이크로 스코프' + checked_at: 2026-07-24T09:26:01+09:00 +- advisor: implementation-advisor + decision: skip + rationale: '파일 3개·경합 없음, orchestrator 직접 구현 (SKILL §5.1 마이크로 편집 예외)' + checked_at: 2026-07-24T09:26:01+09:00 + +## Invocations +[] + +## Summary +포스팅 목록(`/posts`) 글쓰기 진입점 2곳(헤더 링크, 빈 상태 버튼)을 `canWrite` 조건부로 감싸 +POST_WRITE 권한 없는 세션엔 노출되지 않도록 변경. 서버측 신규 게이트 로직 없음 — +기존 `PostController.requireWritePermission`/`create()`가 쓰던 +`gate.has(session, PermissionKeys.POST_WRITE.name())`를 `list()`에서도 재사용해 +`canWrite` model attribute로 view에 전달. + +## Decisions +- canWrite 판정은 `PermissionGate.has(session, PermissionKeys.POST_WRITE.name())` 재사용 (신규 로직 없음) +- posts-empty.jspf 는 `<%@ include %>` static include라 posts-list.jsp 스크립틀릿 변수(canWrite)가 + 그대로 보임 — 별도 request attribute 전달/재계산 불필요 + +## Verified_by_me +- L1 typecheck: `docker compose exec app mvn -o -P dev -DskipTests compile` → BUILD SUCCESS +- 통합 스모크(수동, 실행 중인 dev 앱 대상): + - 익명 세션 `GET /posts` → "글쓰기" 텍스트 0건 (헤더 링크·빈상태 버튼 모두 미노출) + - `admin@bibimbap.local` 로그인 세션 `GET /posts` → 헤더 `글쓰기` + + 빈상태 `+ 글쓰기` 버튼 둘 다 노출 +- L2: skip (외부 의존 계약 변경 없음) + +## Needs_user_verification +- (없음) — dev 컨테이너 재시작으로 즉시 반영 확인 완료. 운영 배포 시엔 일반 배포 절차(재빌드/재시작)만 필요. + +## graph_refresh +decision: handled_inline +judgment: partial-stale +scopes_processed: [full] +reason: '변경 4파일(≤5) → B-1 인스턴스 내 즉시 처리. incremental update로 1477→1507 노드(고스트 중복 20 exact+11 fuzzy 제거), 76 커뮤니티 불변이라 기존 라벨 재사용. docs/graph/index.md 메타 갱신 완료. JSP/JSPF 확장자는 graphify 스캔 범위 밖이라 posts-list.jsp/posts-empty.jspf 변경은 그래프 미반영(기존 한계, 이번 세션 이슈 아님).' diff --git a/docs/graph/index.md b/docs/graph/index.md index 3b1f363..c77db7c 100644 --- a/docs/graph/index.md +++ b/docs/graph/index.md @@ -1,7 +1,7 @@ --- kind: graphify-meta -last_generated_at: 2026-07-01T14:35:00+0900 -source_commit: 86b0528 +last_generated_at: 2026-07-24T09:43:00+0900 +source_commit: 6154826 scopes: - full --- @@ -39,7 +39,7 @@ scope 예시: `full`, `src`, `docs`, `src-features` 등. | scope | 마지막 생성 | 소스 커밋 | 대상 경로 | 요약 | | --- | --- | --- | --- | --- | -| `full` | 2026-07-01 | `86b0528` | `src/` + `docs/` | **incremental update** — 18커밋분 변경(11 파일: db/seed-dev.sql + docs 10건) 재추출 후 `build_merge` 병합 시 고스트 중복 486 exact + 251 fuzzy 추가 제거(2089→1477 노드, 4503 엣지, 76 커뮤니티). game-register.jsp 리디자인 보강·frontend-redesign-coverage-checklist·workflow-patterns 신규 노드 반영. JSP/CSS 정적자산은 여전히 스캔 범위 외. | +| `full` | 2026-07-24 | `6154826` | `src/` + `docs/` | **incremental update** — 3커밋분 변경(4 파일: PostController.java + docs 3건) 재추출 후 `build_merge` 병합 시 고스트 중복 20 exact + 11 fuzzy 추가 제거(1477→1507 노드, 4570 엣지, 76 커뮤니티 — 커뮤니티 수 불변이라 기존 라벨 재사용). `posts-list.jsp`/`posts-empty.jspf` 는 canWrite 권한 조건부 렌더 추가했으나 JSP 확장자가 여전히 스캔 범위 밖이라 그래프 미반영. | ## 갱신 시 체크리스트 diff --git a/src/main/java/com/pandoli365/bibimbap/controller/PostController.java b/src/main/java/com/pandoli365/bibimbap/controller/PostController.java index 841df37..46209ea 100644 --- a/src/main/java/com/pandoli365/bibimbap/controller/PostController.java +++ b/src/main/java/com/pandoli365/bibimbap/controller/PostController.java @@ -64,6 +64,7 @@ public class PostController { @RequestParam(name = "categoryId", required = false) Long categoryId, @RequestParam(name = "cursorCreatedAt", required = false) String cursorCreatedAt, @RequestParam(name = "cursorId", required = false) Long cursorId, + HttpSession session, Model model ) { OffsetDateTime cursor = parseOffsetDateTime(cursorCreatedAt); @@ -78,6 +79,7 @@ public class PostController { model.addAttribute("categories", postCategoriesMapper.listActive()); model.addAttribute("categoryId", categoryId); model.addAttribute("hasNext", hasNext); + model.addAttribute("canWrite", gate.has(session, PermissionKeys.POST_WRITE.name())); if (hasNext && !rows.isEmpty()) { PostData last = rows.get(rows.size() - 1); model.addAttribute("nextCursorCreatedAt", last.getCreatedAt()); diff --git a/src/main/webapp/WEB-INF/views/fragments/posts-empty.jspf b/src/main/webapp/WEB-INF/views/fragments/posts-empty.jspf index abd7ac8..f697fb5 100644 --- a/src/main/webapp/WEB-INF/views/fragments/posts-empty.jspf +++ b/src/main/webapp/WEB-INF/views/fragments/posts-empty.jspf @@ -15,7 +15,9 @@

아직 등록된 포스트가 없어요

개발 일지, 팁, 질문 무엇이든 좋아요. 커뮤니티의 첫 글을 남겨보세요.

+ <% if (canWrite) { %>
+ 글쓰기
+ <% } %> diff --git a/src/main/webapp/WEB-INF/views/posts-list.jsp b/src/main/webapp/WEB-INF/views/posts-list.jsp index fb2c49e..f5cc579 100644 --- a/src/main/webapp/WEB-INF/views/posts-list.jsp +++ b/src/main/webapp/WEB-INF/views/posts-list.jsp @@ -16,6 +16,7 @@ if (categoriesAttr instanceof List) { categories = (List) categoriesAttr; } Long categoryId = (Long) request.getAttribute("categoryId"); boolean hasNext = Boolean.TRUE.equals(request.getAttribute("hasNext")); + boolean canWrite = Boolean.TRUE.equals(request.getAttribute("canWrite")); OffsetDateTime nextCursorCreatedAt = (OffsetDateTime) request.getAttribute("nextCursorCreatedAt"); Long nextCursorId = (Long) request.getAttribute("nextCursorId"); %> @@ -227,7 +228,9 @@

POSTING

포스팅

+ <% if (canWrite) { %> 글쓰기 + <% } %>