From 730065a3dc72683460b95ba1486dba8ec355a373 Mon Sep 17 00:00:00 2001 From: David Svantesson Date: Tue, 24 Sep 2019 03:30:40 +0200 Subject: [PATCH] Do only show teams access for organization repositories, not for personal repositories (#8265) Signed-off-by: David Svantesson --- modules/context/repo.go | 1 + templates/repo/settings/collaboration.tmpl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules/context/repo.go b/modules/context/repo.go index 3ef726f2e8..3caf583f83 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -395,6 +395,7 @@ func RepoAssignment() macaron.Handler { ctx.Data["Owner"] = ctx.Repo.Repository.Owner ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner() ctx.Data["IsRepositoryAdmin"] = ctx.Repo.IsAdmin() + ctx.Data["RepoOwnerIsOrganization"] = repo.Owner.IsOrganization() ctx.Data["CanWriteCode"] = ctx.Repo.CanWrite(models.UnitTypeCode) ctx.Data["CanWriteIssues"] = ctx.Repo.CanWrite(models.UnitTypeIssues) ctx.Data["CanWritePulls"] = ctx.Repo.CanWrite(models.UnitTypePullRequests) diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index b65fd4e167..61feb4ec18 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -52,6 +52,7 @@ + {{if .RepoOwnerIsOrganization}}

Teams

@@ -108,6 +109,7 @@ {{end}} + {{end}}