|
|
|
@ -119,16 +119,16 @@ public class DataShareModel {
|
|
|
|
|
if (StrKit.isBlank(subscribe_system_ids)) {
|
|
|
|
|
//这个系统已经订阅了哪些系统的哪些表
|
|
|
|
|
String sql = "select subscribe_system_ids from t_datashare_system where system_id=?";
|
|
|
|
|
subscribe_system_ids = Db.queryStr(sql, system_id);
|
|
|
|
|
String exist_subscribe_system_ids = Db.queryStr(sql, system_id);
|
|
|
|
|
//对于这些表都需要回收此用户的读权限
|
|
|
|
|
for (String s : subscribe_system_ids.split(",")) {
|
|
|
|
|
for (String s : exist_subscribe_system_ids.split(",")) {
|
|
|
|
|
List<Record> list = getShareTable(Integer.parseInt(s));
|
|
|
|
|
for (Record r : list) {
|
|
|
|
|
PgUtil.revokeUserPrivilege(user_name, r.getStr("table_name"), PgUtil.READ);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sql = "update t_datashare_system set subscribe_system_ids=? where system_id=?";
|
|
|
|
|
Db.update(sql, subscribe_system_ids, system_id);
|
|
|
|
|
sql = "update t_datashare_system set subscribe_system_ids=null where system_id=?";
|
|
|
|
|
Db.update(sql, system_id);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//如果是修改为新的订阅系统
|
|
|
|
|