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-12 14:14:45 +0200
commit0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608 (patch)
tree7068350836e187523f0bcf741695c84c0eab42a9 /routers/org/teams.go
parent2804784df93f392ed76a85d8e7153c66964f1ba5 (diff)
downloadgitea-0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608.tar.gz
gitea-0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608.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 9dd9b8e229..f5f94be0f4 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -165,14 +165,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
@@ -246,14 +246,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