permission
This commit is contained in:
@@ -76,27 +76,27 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
|
||||
var n int
|
||||
var mmlResult []string
|
||||
|
||||
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")
|
||||
log.Error(errMsg)
|
||||
mmlResult = append(mmlResult, errMsg)
|
||||
response := Response{mmlResult}
|
||||
services.ResponseWithJson(w, http.StatusOK, response)
|
||||
//services.ResponseForbidden403NotPermission(w)
|
||||
return
|
||||
}
|
||||
if !exist {
|
||||
log.Error("Not permission!")
|
||||
errMsg := fmt.Sprintf("RetCode = -1 operation failed: do not have the operation permissions")
|
||||
log.Error(errMsg)
|
||||
mmlResult = append(mmlResult, errMsg)
|
||||
response := Response{mmlResult}
|
||||
services.ResponseWithJson(w, http.StatusOK, response)
|
||||
//services.ResponseForbidden403NotPermission(w)
|
||||
return
|
||||
}
|
||||
// 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")
|
||||
// log.Error(errMsg)
|
||||
// mmlResult = append(mmlResult, errMsg)
|
||||
// response := Response{mmlResult}
|
||||
// services.ResponseWithJson(w, http.StatusOK, response)
|
||||
// //services.ResponseForbidden403NotPermission(w)
|
||||
// return
|
||||
// }
|
||||
// if !exist {
|
||||
// log.Error("Not permission!")
|
||||
// errMsg := fmt.Sprintf("RetCode = -1 operation failed: do not have the operation permissions")
|
||||
// log.Error(errMsg)
|
||||
// mmlResult = append(mmlResult, errMsg)
|
||||
// response := Response{mmlResult}
|
||||
// services.ResponseWithJson(w, http.StatusOK, response)
|
||||
// //services.ResponseForbidden403NotPermission(w)
|
||||
// return
|
||||
// }
|
||||
|
||||
if strings.ToLower(neType) == "omc" {
|
||||
PostMMLToOMC(w, r)
|
||||
|
||||
Reference in New Issue
Block a user