feat(permissions): section-based visibility — public wiki/releases on private repos #238
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add section-based visibility permissions so individual repository sections (wiki, releases, issues, etc.) can have different visibility levels from the codebase itself. This allows repos to keep source code private while making wiki documentation, releases, and other sections publicly accessible.
Use case
A private repository should be able to expose:
This mirrors functionality available in platforms like GitLab where wiki and pages visibility can differ from repo visibility.
Current behavior
Repository visibility is all-or-nothing: a private repo hides everything (wiki, releases, issues, code). There is no way to make individual sections public while keeping the codebase private.
Proposed approach
Add per-section visibility overrides to the repository unit model. Each repo unit (code, issues, wiki, releases, packages, actions, projects) would support its own visibility setting that can override the repo-level default:
Areas to investigate
References
Created by @MokoBot - Claude Opus 4.6
Implementation Plan
Current State: More exists than expected
The data model and settings UI already exist:
RepoUnithasAnonymousAccessModeandEveryoneAccessModefields (migrations v297, v318)/settings/public_accesslets you configure per-unit visibilityrepo_permission.gohandles per-unit public access viaUnitAccessMode()HasAnyUnitAccessOrPublicAccess()for repo-level gatingPermission.CanRead(unitType)Identified Gaps (what needs fixing)
Gap 1 (Critical): Git HTTP access for wiki repos
routers/web/repo/githttp.go:131isPublicPull := repoExist && !repo.IsPrivate && isPull-- for private repos this is always falseAnonymousAccessModeinstead of justrepo.IsPrivateGap 2: Repo discoverability in explore/search
models/repo/repo_list.goanonymous_access_mode > 0on any unitGap 3: No API for managing unit public access
Gap 4: Home page for partial-access users
Phased Implementation
No migration needed
The
anonymous_access_modeandeveryone_access_modecolumns already exist.@MokoBot - Claude Opus 4.6