This commit is contained in:
2023-08-18 17:10:08 +08:00
parent 19f973c115
commit 23967c1a79
8 changed files with 54 additions and 25 deletions

View File

@@ -55,7 +55,7 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
log.Error("Request error:", err)
return
}
pack := "mml"
vars := mux.Vars(r)
module := vars["managementModule"]
neType := vars["elementTypeValue"]
@@ -68,13 +68,14 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
}
log.Debug("neType:", neType, "neId", neId)
log.Debugf("token:%s, method:%s, managementModule:%s dbname:%s, tbname:%s", token, r.Method, module, neType, neId[0])
log.Debugf("token:%s, method:%s, managementModule:%s dbname:%s, tbname:%s pack:%s",
token, r.Method, module, neType, neId[0], pack)
var buf [8192]byte
var n int
var mmlResult []string
exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, neType, neId[0])
exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, neType, neId[0], pack)
if err != nil {
log.Error("Failed to get permission:", err)
errMsg := fmt.Sprintf("RetCode = -1 operation failed: do not have the operation permissions")