From 8c4588c4c9844bb9f5e39df5fcaadca7fd6170cd Mon Sep 17 00:00:00 2001
From: Florian Kaiser <florian.kaiser@fnkr.net>
Date: Sun, 31 Jan 2016 15:18:28 +0000
Subject: [PATCH] Refactor .IsAdminTeam to .IsTeamAdmin and requireAdminTeam to
 requireTeamAdmin

---
 modules/middleware/context.go |  2 +-
 modules/middleware/org.go     | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 59e95aada..cd11c08b1 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -66,7 +66,7 @@ type Context struct {
 		IsOwner      bool
 		IsMember     bool
 		IsTeamMember bool // Is member of team.
-		IsAdminTeam  bool // In owner team or team that has admin permission level.
+		IsTeamAdmin  bool // In owner team or team that has admin permission level.
 		Organization *models.User
 		OrgLink      string
 
diff --git a/modules/middleware/org.go b/modules/middleware/org.go
index 34ec90dc6..99c4cf9d5 100644
--- a/modules/middleware/org.go
+++ b/modules/middleware/org.go
@@ -18,7 +18,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
 		requireMember     bool
 		requireOwner      bool
 		requireTeamMember bool
-		requireAdminTeam  bool
+		requireTeamAdmin  bool
 	)
 	if len(args) >= 1 {
 		requireMember = args[0]
@@ -30,7 +30,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
 		requireTeamMember = args[2]
 	}
 	if len(args) >= 4 {
-		requireAdminTeam = args[3]
+		requireTeamAdmin = args[3]
 	}
 
 	orgName := ctx.Params(":org")
@@ -59,13 +59,13 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
 		ctx.Org.IsOwner = true
 		ctx.Org.IsMember = true
 		ctx.Org.IsTeamMember = true
-		ctx.Org.IsAdminTeam = true
+		ctx.Org.IsTeamAdmin = true
 	} else if ctx.IsSigned {
 		ctx.Org.IsOwner = org.IsOwnedBy(ctx.User.Id)
 		if ctx.Org.IsOwner {
 			ctx.Org.IsMember = true
 			ctx.Org.IsTeamMember = true
-			ctx.Org.IsAdminTeam = true
+			ctx.Org.IsTeamAdmin = true
 		} else {
 			if org.IsOrgMember(ctx.User.Id) {
 				ctx.Org.IsMember = true
@@ -118,9 +118,9 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
 			return
 		}
 
-		ctx.Org.IsAdminTeam = ctx.Org.Team.IsOwnerTeam() || ctx.Org.Team.Authorize >= models.ACCESS_MODE_ADMIN
-		ctx.Data["IsAdminTeam"] = ctx.Org.IsAdminTeam
-		if requireAdminTeam && !ctx.Org.IsAdminTeam {
+		ctx.Org.IsTeamAdmin = ctx.Org.Team.IsOwnerTeam() || ctx.Org.Team.Authorize >= models.ACCESS_MODE_ADMIN
+		ctx.Data["IsTeamAdmin"] = ctx.Org.IsTeamAdmin
+		if requireTeamAdmin && !ctx.Org.IsTeamAdmin {
 			ctx.Handle(404, "OrgAssignment", err)
 			return
 		}