use of com.cubrid.cubridmanager.core.cubrid.user.model.AuthType in project cubrid-manager by CUBRID.
the class GetAllUserAuthorizationsTask method execute.
public void execute() {
String sql = "SELECT grantor_name, grantee_name, class_name, auth_type, is_grantable FROM db_auth";
sql = databaseInfo.wrapShardQuery(sql);
try {
stmt = connection.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) {
//String grantorName = rs.getString("grantor_name");
String granteeName = rs.getString("grantee_name");
String className = rs.getString("class_name");
String authType = rs.getString("auth_type");
boolean isGrantable = StringUtil.booleanValueWithYN(rs.getString("is_grantable"));
// }
if (StringUtil.isEmpty(className)) {
continue;
}
if (granteeName != null) {
granteeName = granteeName.toLowerCase(Locale.getDefault());
}
UserDetailInfo userInfo = allAuthMap.get(granteeName);
if (userInfo == null) {
userInfo = new UserDetailInfo();
userInfo.setUserName(granteeName);
allAuthMap.put(granteeName, userInfo);
}
AuthType type = AuthType.getAuthType(authType, isGrantable);
userInfo.addAuth(className, type);
}
} catch (SQLException e) {
errorMsg = e.getMessage();
} finally {
QueryUtil.freeQuery(stmt, rs);
}
loadDetailInfo();
finish();
}
Aggregations