permission

This commit is contained in:
2023-09-07 17:50:26 +08:00
parent 36918bd4fa
commit 09c7b751fc
3 changed files with 82 additions and 80 deletions

View File

@@ -4,7 +4,6 @@ import (
"fmt"
"net/http"
"os/exec"
"strings"
"time"
"ems.agt/lib/global"
@@ -96,17 +95,17 @@ func ExtDatabaseBackupData(w http.ResponseWriter, r *http.Request) {
tbname := vars["dataObject"]
pack := "lm"
log.Debugf("token:%s, method:%s, module:%s dbname:%s, tbname:%s pack:%s", token, r.Method, module, dbname, tbname, pack)
exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, dbname, tbname, pack)
if err != nil {
log.Error("Failed to get permission:", err)
services.ResponseForbidden403NotPermission(w)
return
}
if !exist {
log.Error("permission deny!")
services.ResponseForbidden403NotPermission(w)
return
}
// exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, dbname, tbname, pack)
// if err != nil {
// log.Error("Failed to get permission:", err)
// services.ResponseForbidden403NotPermission(w)
// return
// }
// if !exist {
// log.Error("permission deny!")
// services.ResponseForbidden403NotPermission(w)
// return
// }
var sql string
var filePath string