mml
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user