Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission (#34053) (#34065)

Backport #34053 

When a team have no code unit permission of a repository, the member of
the team should not view activity contributors, recent commits and code
frequrency.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2025-03-30 03:30:55 -07:00
committed by GitHub
parent 15e93a751c
commit f8f24d83cf
4 changed files with 30 additions and 38 deletions

View File

@@ -34,7 +34,7 @@ func CodeFrequencyData(ctx *context.Context) {
ctx.Status(http.StatusAccepted)
return
}
ctx.ServerError("GetCodeFrequencyData", err)
ctx.ServerError("GetContributorStats", err)
} else {
ctx.JSON(http.StatusOK, contributorStats["total"].Weeks)
}