feat: 업무 수정/편집을 지시자 전용으로 + 더보기 메뉴를 삭제만 남김
- 상세 우측 상단 액션(수정 버튼 + 더보기 메뉴) 전체를 isIssuer 일 때만 노출 - 더보기 메뉴에서 업무 복제·링크 복사 제거, 업무 삭제만 유지 - 편집 화면(/edit) 진입을 지시자 본인만 허용(그 외 상세로 리다이렉트). 생성 모드는 기존대로 관리자만 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -64,9 +64,8 @@ const repo = ref<Project | null>(null)
|
||||
async function loadProject() {
|
||||
try {
|
||||
repo.value = await projectStore.fetchOne(projectId.value)
|
||||
// 업무 작성/수정은 프로젝트 관리자만 가능 — 일반 멤버는 진입 즉시 상세로 돌려보낸다
|
||||
// (백엔드도 admin 전용이지만, 폼 화면 자체를 열지 못하게 막는다)
|
||||
if (repo.value && !repo.value.canManage) {
|
||||
// 생성 모드: 프로젝트 관리자만 진입 가능. (편집 모드 권한은 지시자 기준으로 loadTaskForEdit 에서 검사)
|
||||
if (!isEdit.value && repo.value && !repo.value.canManage) {
|
||||
void dialog.alert('업무 작성은 프로젝트 관리자만 가능합니다.', { variant: 'warning' })
|
||||
await router.replace(`/projects/${projectId.value}`)
|
||||
}
|
||||
@@ -87,6 +86,12 @@ async function loadTaskForEdit() {
|
||||
if (taskId.value === null) return
|
||||
try {
|
||||
const t = await taskApi.get(projectId.value, taskId.value)
|
||||
// 편집은 지시자 본인만 — 그 외에는 상세로 돌려보낸다
|
||||
if (t.issuer?.id !== authStore.user?.id) {
|
||||
void dialog.alert('업무 수정은 지시자만 가능합니다.', { variant: 'warning' })
|
||||
await router.replace(`/projects/${projectId.value}/tasks/${taskId.value}`)
|
||||
return
|
||||
}
|
||||
title.value = t.title
|
||||
contentText.value = t.content.join('\n')
|
||||
dueDate.value = t.dueDate ? toDateInput(t.dueDate) : ''
|
||||
|
||||
@@ -533,7 +533,10 @@ function badgeFor(name: string | undefined): { label: string; cls: string } {
|
||||
{{ task.title }}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div
|
||||
v-if="isIssuer"
|
||||
class="actions"
|
||||
>
|
||||
<RouterLink
|
||||
class="btn"
|
||||
:to="`/projects/${projectId}/tasks/${task.id}/edit`"
|
||||
@@ -585,41 +588,6 @@ function badgeFor(name: string | undefined): { label: string; cls: string } {
|
||||
class="menu"
|
||||
:class="{ open: moreOpen }"
|
||||
>
|
||||
<button
|
||||
class="menu-item"
|
||||
type="button"
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
><rect
|
||||
x="9"
|
||||
y="9"
|
||||
width="13"
|
||||
height="13"
|
||||
rx="2"
|
||||
/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" /></svg>
|
||||
업무 복제
|
||||
</button>
|
||||
<button
|
||||
class="menu-item"
|
||||
type="button"
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
><path d="M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1" /><path d="M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1" /></svg>
|
||||
링크 복사
|
||||
</button>
|
||||
<div class="menu-sep" />
|
||||
<button
|
||||
class="menu-item danger"
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user