[PR #2537] [MERGED] fix: use recursive CTE in accessibleProjectIDsSubquery for inherited project permissions #8347

Closed
opened 2026-04-20 18:09:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2537
Author: @tink-bot
Created: 4/3/2026
Status: Merged
Merged: 4/5/2026
Merged by: @kolaente

Base: mainHead: fix-subtask-permission-hierarchy


📝 Commits (1)

  • 7eb2617 fix: use recursive CTE in accessibleProjectIDsSubquery for inherited project permissions

📊 Changes

10 files changed (+209 additions, -7 deletions)

View changed files

📝 pkg/db/fixtures/project_views.yml (+50 -0)
📝 pkg/db/fixtures/projects.yml (+21 -0)
📝 pkg/db/fixtures/task_relations.yml (+13 -0)
📝 pkg/db/fixtures/tasks.yml (+18 -0)
📝 pkg/db/fixtures/team_members.yml (+3 -0)
📝 pkg/db/fixtures/team_projects.yml (+7 -0)
📝 pkg/db/fixtures/teams.yml (+3 -0)
📝 pkg/models/project.go (+23 -6)
📝 pkg/models/project_test.go (+1 -1)
📝 pkg/models/task_relation_authz_test.go (+70 -0)

📄 Description

Users with team access on a parent project could not see subtask relations for tasks in child projects, because accessibleProjectIDsSubquery() used a non-recursive query that only returned directly accessible projects.

The fix wraps the base query in a recursive CTE that walks child projects via parent_project_id, matching the permission model already used in getAllProjectsForUser().

Fixes #2490


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2537 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 4/3/2026 **Status:** ✅ Merged **Merged:** 4/5/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix-subtask-permission-hierarchy` --- ### 📝 Commits (1) - [`7eb2617`](https://github.com/go-vikunja/vikunja/commit/7eb26176f8783f5f88992237ccefcc4c599674d5) fix: use recursive CTE in accessibleProjectIDsSubquery for inherited project permissions ### 📊 Changes **10 files changed** (+209 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `pkg/db/fixtures/project_views.yml` (+50 -0) 📝 `pkg/db/fixtures/projects.yml` (+21 -0) 📝 `pkg/db/fixtures/task_relations.yml` (+13 -0) 📝 `pkg/db/fixtures/tasks.yml` (+18 -0) 📝 `pkg/db/fixtures/team_members.yml` (+3 -0) 📝 `pkg/db/fixtures/team_projects.yml` (+7 -0) 📝 `pkg/db/fixtures/teams.yml` (+3 -0) 📝 `pkg/models/project.go` (+23 -6) 📝 `pkg/models/project_test.go` (+1 -1) 📝 `pkg/models/task_relation_authz_test.go` (+70 -0) </details> ### 📄 Description Users with team access on a parent project could not see subtask relations for tasks in child projects, because `accessibleProjectIDsSubquery()` used a non-recursive query that only returned directly accessible projects. The fix wraps the base query in a recursive CTE that walks child projects via `parent_project_id`, matching the permission model already used in `getAllProjectsForUser()`. Fixes #2490 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:09:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8347