|
@@ -180,7 +180,7 @@ func ReEmpower(appid string, function_code []string, ent_id int64, ent_user_id [
|
|
|
return 0, errors.New("无效的参数ent_id")
|
|
|
} else if len(ent_user_id) == 0 {
|
|
|
return 0, errors.New("无效的参数ent_user_id")
|
|
|
- } else if status, err := Base_ent_wait_empower.CheckBeforeEmpower(appid, function_code, ent_id, ent_user_id); err != nil {
|
|
|
+ } else if status, err := Base_ent_wait_empower.CheckFunctionCode(appid, function_code, ent_id); err != nil {
|
|
|
return status, err
|
|
|
}
|
|
|
if Base_ent_empower.ReEmpower(appid, function_code, ent_id, ent_user_id) {
|
|
@@ -209,17 +209,22 @@ func CrReEmpower(appid string, function_module, function_code []string, ent_id i
|
|
|
return 0, errors.New("无效的参数ent_id")
|
|
|
} else if len(ent_user_id) == 0 {
|
|
|
return 0, errors.New("无效的参数ent_user_id")
|
|
|
- } else if status, err := Base_ent_wait_empower.CheckBeforeEmpower(appid, function_code, ent_id, ent_user_id); err != nil {
|
|
|
+ } else if status, err := Base_ent_wait_empower.CheckFunctionCode(appid, function_code, ent_id); err != nil {
|
|
|
return status, err
|
|
|
}
|
|
|
+ var err error
|
|
|
+ var status int64
|
|
|
if Mysql_BaseService.ExecTx("根据功能分类取消所有授权", func(tx *sql.Tx) bool {
|
|
|
ok1 := Base_ent_empower.CancelAllEmpower(tx, appid, function_module, ent_id, ent_user_id)
|
|
|
ok2 := Base_ent_empower.Empower(tx, appid, function_code, ent_id, ent_user_id)
|
|
|
+ if status, err = Base_ent_empower.CheckEmpowerCount(tx, appid, function_code, ent_id); err != nil {
|
|
|
+ return false
|
|
|
+ }
|
|
|
return ok1 && ok2
|
|
|
}) {
|
|
|
- return 1, nil
|
|
|
+ status = 1
|
|
|
}
|
|
|
- return 0, nil
|
|
|
+ return status, err
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -239,7 +244,7 @@ func Empower(appid string, function_code []string, ent_id int64, ent_user_id []i
|
|
|
return 0, errors.New("无效的参数ent_id")
|
|
|
} else if len(ent_user_id) == 0 {
|
|
|
return 0, errors.New("无效的参数ent_user_id")
|
|
|
- } else if status, err := Base_ent_wait_empower.CheckBeforeEmpower(appid, function_code, ent_id, ent_user_id); err != nil {
|
|
|
+ } else if status, err := Base_ent_wait_empower.CheckFunctionCode(appid, function_code, ent_id); err != nil {
|
|
|
return status, err
|
|
|
}
|
|
|
if Mysql_BaseService.ExecTx("授权", func(tx *sql.Tx) bool {
|