Skip to content

Commit

Permalink
Only show accessible teams in dashboard dropdown list (#19642)
Browse files Browse the repository at this point in the history
Fixes #19637
  • Loading branch information
jpraet authored May 7, 2022
1 parent 672e5a7 commit 38d72d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions modules/context/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
ctx.ContextUser = org.AsUser()
ctx.Data["Org"] = org

teams, err := org.LoadTeams()
if err != nil {
ctx.ServerError("LoadTeams", err)
}
ctx.Data["OrgTeams"] = teams

// Admin has super access.
if ctx.IsSigned && ctx.Doer.IsAdmin {
ctx.Org.IsOwner = true
Expand Down
2 changes: 1 addition & 1 deletion templates/user/dashboard/navbar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<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}}">
{{.i18n.Tr "all"}}
</a>
{{range .OrgTeams}}
{{range .Teams}}
{{if not .IncludesAllRepositories}}
<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}}">
{{.Name}}
Expand Down

0 comments on commit 38d72d4

Please sign in to comment.