This commit is contained in:
simonzhangsz committed 2023-08-18 13:57:36 +08:00
1 parent 3e726ddd99
commit 882baa2e0b
5 files changed
+49 -34

No files matched your search

+11 -2
View File
@@ -417,9 +417,18 @@ func CheckCommonValidRequest(w http.ResponseWriter, r *http.Request) (string, er
return token, nil
}
func CheckUserPermission(token, method, dbname, tbname string) (bool, error) {
func CheckUserPermission(token, method, module, dbname, tbname string) (bool, error) {
if config.GetYamlConfig().OMC.RBACMode == true {
exist, err := dborm.IsPermissionAllowed(token, method, dbname, tbname)
if module == "" {
module = "*"
}
if dbname == "" {
dbname = "*"
}
if tbname == "" {
tbname = "*"
}
exist, err := dborm.IsPermissionAllowed(token, method, module, dbname, tbname)
if err != nil {
return false, err
}