Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

fix: read correct goal permissions for task checkbox

Nikolai Giman7b24da0688c4
diff --git a/web/src/components/features/tasks/parts/TaskItem.vue b/web/src/components/features/tasks/parts/TaskItem.vue
index 065c1d5..b8d9d61 100644
--- a/web/src/components/features/tasks/parts/TaskItem.vue
+++ b/web/src/components/features/tasks/parts/TaskItem.vue
@@ -123,7 +123,7 @@ import { useGoalListsStore } from '@/stores/goal-lists.store'
import { useCollaborationStore } from '@/stores/collaboration.store'
import { useTagsStore } from '@/stores/tag.store'
import { formatDate } from '@vueuse/core'
-import { useGoalPermissions } from '@/composables/useGoalPermissions'
+import { AllGoalPermissions } from '@/types/goals.types'
import { useTaskDetailPanel } from '@/composables/useTaskDetailPanel'
const TOGGLE_DELAY = 200
@@ -138,7 +138,11 @@ const emit = defineEmits<{
click: [taskId: number]
toggle: [task: Task]
}>()
-const { canEditTaskStatus } = useGoalPermissions()
+const goalsStore = useGoalsStore()
+const canEditTaskStatus = computed(() => {
+ const goal = goalsStore.goalMap.get(props.task.goalId)
+ return !!goal?.permissions[AllGoalPermissions.TASK_CAN_EDIT_STATUS]
+})
const { openTask } = useTaskDetailPanel()
const localComplete = ref(!!props.task.complete)
@@ -157,7 +161,6 @@ function handleOpenTask() {
openTask(props.task.id)
}
-const goalsStore = useGoalsStore()
const goalListsStore = useGoalListsStore()
const collaborationStore = useCollaborationStore()
const tagsStore = useTagsStore()