summaryrefslogtreecommitdiffstats
path: root/routers/org/teams.go
diff options
context:
space:
mode:
authorPeter Smit <peter@smitmail.eu>2015-02-05 15:29:08 +0200
committerPeter Smit <peter@smitmail.eu>2015-02-06 13:18:11 +0200
commit4e79adf6b5bf7ec7bc3b2b47469baafd1cb0b774 (patch)
tree7c9ffe3d741408b5b3c33974b5143b9a50646e02 /routers/org/teams.go
parent03af37554e34582e8c5a9d98ec9f2d3c9884f0d8 (diff)
downloadgitea-4e79adf6b5bf7ec7bc3b2b47469baafd1cb0b774.tar.gz
gitea-4e79adf6b5bf7ec7bc3b2b47469baafd1cb0b774.zip
Refactoring of the Access Table
This commit does a lot of the work of refactoring the access table in a table with id's instead of strings. The result does compile, but has not been tested. It may eat your kittens.
Diffstat (limited to 'routers/org/teams.go')
-rw-r--r--routers/org/teams.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index 77a7b6e13c..4fef02c987 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -168,14 +168,14 @@ func NewTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) {
}
// Validate permission level.
- var auth models.AuthorizeType
+ var auth models.AccessMode
switch form.Permission {
case "read":
- auth = models.ORG_READABLE
+ auth = models.ReadAccess
case "write":
- auth = models.ORG_WRITABLE
+ auth = models.WriteAccess
case "admin":
- auth = models.ORG_ADMIN
+ auth = models.AdminAccess
default:
ctx.Error(401)
return
@@ -249,14 +249,14 @@ func EditTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) {
isAuthChanged := false
if !t.IsOwnerTeam() {
// Validate permission level.
- var auth models.AuthorizeType
+ var auth models.AccessMode
switch form.Permission {
case "read":
- auth = models.ORG_READABLE
+ auth = models.ReadAccess
case "write":
- auth = models.ORG_WRITABLE
+ auth = models.WriteAccess
case "admin":
- auth = models.ORG_ADMIN
+ auth = models.AdminAccess
default:
ctx.Error(401)
return