Skip to content

Commit c8a83ac

Browse files
authored
Only show accessible teams in dashboard dropdown list (#19642) (#19645)
Fixes #19637
1 parent 59d132f commit c8a83ac

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
@@ -70,12 +70,6 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
7070
org := ctx.Org.Organization
7171
ctx.Data["Org"] = org
7272

73-
teams, err := org.LoadTeams()
74-
if err != nil {
75-
ctx.ServerError("LoadTeams", err)
76-
}
77-
ctx.Data["OrgTeams"] = teams
78-
7973
// Admin has super access.
8074
if ctx.IsSigned && ctx.User.IsAdmin {
8175
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)