Skip to content

Commit 730065a

Browse files
davidsvantessonlunny
authored andcommitted
Do only show teams access for organization repositories, not for personal repositories (#8265)
Signed-off-by: David Svantesson <[email protected]>
1 parent b6cfca6 commit 730065a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

modules/context/repo.go

+1
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ func RepoAssignment() macaron.Handler {
395395
ctx.Data["Owner"] = ctx.Repo.Repository.Owner
396396
ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner()
397397
ctx.Data["IsRepositoryAdmin"] = ctx.Repo.IsAdmin()
398+
ctx.Data["RepoOwnerIsOrganization"] = repo.Owner.IsOrganization()
398399
ctx.Data["CanWriteCode"] = ctx.Repo.CanWrite(models.UnitTypeCode)
399400
ctx.Data["CanWriteIssues"] = ctx.Repo.CanWrite(models.UnitTypeIssues)
400401
ctx.Data["CanWritePulls"] = ctx.Repo.CanWrite(models.UnitTypePullRequests)

templates/repo/settings/collaboration.tmpl

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
</form>
5353
</div>
5454

55+
{{if .RepoOwnerIsOrganization}}
5556
<h4 class="ui top attached header">
5657
Teams
5758
</h4>
@@ -108,6 +109,7 @@
108109
</div>
109110
{{end}}
110111
</div>
112+
{{end}}
111113
</div>
112114
</div>
113115

0 commit comments

Comments
 (0)