summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/models.go4
-rw-r--r--routers/repo/repo.go2
-rw-r--r--serve.go8
3 files changed, 8 insertions, 6 deletions
diff --git a/models/models.go b/models/models.go
index 20f1e02311..d07b1fe384 100644
--- a/models/models.go
+++ b/models/models.go
@@ -76,7 +76,9 @@ func setEngine() {
//x.ShowDebug = true
//orm.ShowErr = true
- //x.ShowSQL = true
+ f, _ := os.Create("xorm.log")
+ orm.Logger = f
+ orm.ShowSQL = true
//log.Trace("Initialized database -> %s", dbName)
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 11e9e2fb65..8b9c9cef5d 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -23,7 +23,7 @@ func Create(req *http.Request, r render.Render) {
}
// TODO: access check
- fmt.Println(req.FormValue("userId"), req.FormValue("name"))
+ //fmt.Println(req.FormValue("userId"), req.FormValue("name"))
id, err := strconv.ParseInt(req.FormValue("userId"), 10, 64)
if err == nil {
diff --git a/serve.go b/serve.go
index b33b05386d..5bf44f4540 100644
--- a/serve.go
+++ b/serve.go
@@ -81,23 +81,23 @@ func runServ(*cli.Context) {
switch {
case isWrite:
- has, err := models.HasAccess(user.Name, repoName, COMMANDS_WRITE[verb])
+ has, err := models.HasAccess(user.Name, repoName, models.AU_WRITABLE)
if err != nil {
println("Inernel error:", err)
return
}
if !has {
- println("You have no right to access this repository")
+ println("You have no right to write this repository")
return
}
case isRead:
- has, err := models.HasAccess(user.Name, repoName, COMMANDS_READONLY[verb])
+ has, err := models.HasAccess(user.Name, repoName, models.AU_READABLE)
if err != nil {
println("Inernel error")
return
}
if !has {
- has, err = models.HasAccess(user.Name, repoName, COMMANDS_WRITE[verb])
+ has, err = models.HasAccess(user.Name, repoName, models.AU_WRITABLE)
if err != nil {
println("Inernel error")
return