feat: 중간 점검 보고 내용은 지시자·담당자만 열람(상태는 전원 노출)

보고 '내용' 열람을 지시자 + 해당 업무 담당자로 제한:
- 백엔드 buildDetail: viewerId 기준으로 권한 없으면 checkpointReports 를 빈 배열로 응답(findOne 에 현재 사용자 전달). 점검일에는 reported 플래그를 두어 상태는 전원 공유
- 프론트: checkpointState 는 reported 플래그 기준, '보고 완료' 클릭(모달)은 지시자·담당자만. 그 외는 비클릭 상태 배지

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 16:01:50 +09:00
parent b717ecd9a5
commit 6577550937
6 changed files with 55 additions and 21 deletions
+6 -4
View File
@@ -322,10 +322,12 @@ const CP_STATE_LABEL: Record<CheckpointState, string> = {
reported: '보고 완료',
missed: '누락',
}
// 체크포인트 상태 — 보고됨 / 당일 / 지남(누락) / 예정
// 보고 '내용' 열람 권한 — 지시자 또는 해당 업무 담당자(백엔드도 동일하게 제한)
const canViewReports = computed(() => isIssuer.value || isAssignee.value)
// 체크포인트 상태 — 보고됨 / 당일 / 지남(누락) / 예정. 보고됨은 reported 플래그(전원 공유) 기준
function checkpointState(cp: TaskCheckpointView): CheckpointState {
const reported = task.value?.checkpointReports.some((r) => r.checkpointId === cp.id) ?? false
if (reported) return 'reported'
if (cp.reported) return 'reported'
const cpDay = kstDate(cp.checkAt)
if (cpDay === todayKst.value) return 'today'
if (cpDay < todayKst.value) return 'missed'
@@ -1279,7 +1281,7 @@ function badgeFor(name: string | undefined): { label: string; cls: string } {
{{ reportingCpId === cp.id ? '취소' : '보고서 작성' }}
</button>
<button
v-else-if="checkpointState(cp) === 'reported'"
v-else-if="checkpointState(cp) === 'reported' && canViewReports"
class="cp-state reported clickable"
type="button"
title="보고 내용 보기"