Skip to content

Commit 74083f8

Browse files
jpraetAbdulrhmnGhanem
authored andcommitted
Only show accessible teams in dashboard dropdown list (go-gitea#19642)
Fixes go-gitea#19637
1 parent 017ec2a commit 74083f8

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

modules/context/org.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
7272
ctx.ContextUser = org.AsUser()
7373
ctx.Data["Org"] = org
7474

75-
teams, err := org.LoadTeams()
76-
if err != nil {
77-
ctx.ServerError("LoadTeams", err)
78-
}
79-
ctx.Data["OrgTeams"] = teams
80-
8175
// Admin has super access.
8276
if ctx.IsSigned && ctx.Doer.IsAdmin {
8377
ctx.Org.IsOwner = true

templates/user/dashboard/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<a class="{{if not $.Team}}active selected{{end}} item" title="{{.i18n.Tr "all"}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
6262
{{.i18n.Tr "all"}}
6363
</a>
64-
{{range .OrgTeams}}
64+
{{range .Teams}}
6565
{{if not .IncludesAllRepositories}}
6666
<a class="{{if $.Team}}{{if eq $.Team.ID .ID}}active selected{{end}}{{end}} item" title="{{.Name}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}/{{.Name}}">
6767
{{.Name}}

0 commit comments

Comments
 (0)