summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-21 12:47:54 -0400
committerUnknwon <u@gogs.io>2016-03-21 12:47:54 -0400
commite6f927f61af927156798390e64f17dd6755697e7 (patch)
treec97f90dfb0f4ae96534c13f98352907fb42d177b /routers/org
parent60ae8ac3d2995d46156ead8ad93004801daad4ce (diff)
downloadgitea-e6f927f61af927156798390e64f17dd6755697e7.tar.gz
gitea-e6f927f61af927156798390e64f17dd6755697e7.zip
#1692 api: admin list and create team under organization
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/teams.go16
1 files changed, 1 insertions, 15 deletions
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