From e6f927f61af927156798390e64f17dd6755697e7 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 21 Mar 2016 12:47:54 -0400 Subject: #1692 api: admin list and create team under organization --- routers/org/teams.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'routers/org/teams.go') diff --git a/routers/org/teams.go b/routers/org/teams.go index e8ae8291b7..430f08ec28 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -154,25 +154,11 @@ func NewTeamPost(ctx *context.Context, form auth.CreateTeamForm) { ctx.Data["PageIsOrgTeams"] = true ctx.Data["PageIsOrgTeamsNew"] = true - // Validate permission level. - var auth models.AccessMode - switch form.Permission { - case "read": - auth = models.ACCESS_MODE_READ - case "write": - auth = models.ACCESS_MODE_WRITE - case "admin": - auth = models.ACCESS_MODE_ADMIN - default: - ctx.Error(401) - return - } - t := &models.Team{ OrgID: ctx.Org.Organization.Id, Name: form.TeamName, Description: form.Description, - Authorize: auth, + Authorize: models.ParseAccessMode(form.Permission), } ctx.Data["Team"] = t -- cgit v1.2.3