tech-debt: Refactor permission checking across codebase #311

Open
opened 2026-05-31 14:10:31 +00:00 by jmiller · 0 comments
Owner

Summary

Permission checking is scattered and inconsistent with multiple TODO/FIXME markers.

Locations

  • models/perm/access/repo_permission.go:50 - most calls should use HasAnyUnitAccessOrPublicAccess
  • models/perm/access/repo_permission.go:430 - rename to IsOwnerVisibleToDoer
  • models/perm/access/repo_permission.go:448 - should only check collaborator access mode
  • models/repo/repo.go:638 - most CanEnableEditor calls should be CanContentChange
  • routers/api/v1/api.go:734 - mustNotBeArchived vs mustEnableEditor inconsistency
  • routers/web/web.go:1319,1394,1420 - pulls/issues endpoint permission mixing

Action Required

Consolidate permission checks into clear, well-named methods. Replace scattered checks with canonical implementations.


Created by Claude Opus 4.6

## Summary Permission checking is scattered and inconsistent with multiple TODO/FIXME markers. ## Locations - `models/perm/access/repo_permission.go:50` - most calls should use HasAnyUnitAccessOrPublicAccess - `models/perm/access/repo_permission.go:430` - rename to IsOwnerVisibleToDoer - `models/perm/access/repo_permission.go:448` - should only check collaborator access mode - `models/repo/repo.go:638` - most CanEnableEditor calls should be CanContentChange - `routers/api/v1/api.go:734` - mustNotBeArchived vs mustEnableEditor inconsistency - `routers/web/web.go:1319,1394,1420` - pulls/issues endpoint permission mixing ## Action Required Consolidate permission checks into clear, well-named methods. Replace scattered checks with canonical implementations. --- *Created by Claude Opus 4.6*
jmiller added the tech-debtupstream labels 2026-05-31 14:10:31 +00:00
Sign in to join this conversation.
No labels tech-debt upstream
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#311