Skip to content

Commit

Permalink
Do only show teams access for organization repositories, not for pers…
Browse files Browse the repository at this point in the history
…onal repositories (#8265)

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
  • Loading branch information
davidsvantesson authored and lunny committed Sep 24, 2019
1 parent b6cfca6 commit 730065a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions templates/repo/settings/collaboration.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
</form>
</div>

{{if .RepoOwnerIsOrganization}}
<h4 class="ui top attached header">
Teams
</h4>
Expand Down Expand Up @@ -108,6 +109,7 @@
</div>
{{end}}
</div>
{{end}}
</div>
</div>

Expand Down

0 comments on commit 730065a

Please sign in to comment.