| … | … | @@ -108,8 +108,15 @@ async function serveHome(req, res, server) { |
| 108 | 108 | // Compute activity graphs (cached, non-blocking) |
| 109 | 109 | const activity = await getActivityData(repoRegistry.gitReposPath, repos).catch(() => ({})) |
| 110 | 110 | |
| 111 | // Filter private repos for non-admin users |
| 112 | const isAdmin = req.user && req.user.globalPermissions && req.user.globalPermissions.admin |
| 113 | const visibleRepos = repos.filter(r => { |
| 114 | if (r.visibility === 'private' && !isAdmin) return false |
| 115 | return true |
| 116 | }) |
| 117 | |
| 111 | 118 | // Attach activity data to repos |
| 112 | | const reposWithActivity = repos.map(r => ({ |
| 119 | const reposWithActivity = visibleRepos.map(r => ({ |
| 113 | 120 | ...r, |
| 114 | 121 | activity: activity[r.name] || null |
| 115 | 122 | })) |