tristaZero commented on a change in pull request #9796:
URL: https://github.com/apache/shardingsphere/pull/9796#discussion_r601226893
##########
File path:
shardingsphere-governance/shardingsphere-governance-context/src/main/java/org/apache/shardingsphere/governance/context/metadata/GovernanceMetaDataContexts.java
##########
@@ -398,4 +415,28 @@ private boolean isModifiedDataSource(final Map<String,
DataSource> oldDataSource
}
return result;
}
+
+ private void reloadPrivilege(final Collection<ShardingSphereUser> users) {
+ Optional<PrivilegeLoader> loader =
PrivilegeLoaderEngine.findPrivilegeLoader(metaDataContexts.getMetaDataMap().values().iterator().next().getResource().getDatabaseType());
+ int maxConnectionsSizePerQuery =
metaDataContexts.getProps().getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY);
+ if (!loader.isPresent()) {
+ return;
+ }
+ Map<ShardingSphereUser, ShardingSpherePrivilege> result = new
LinkedHashMap<>();
+ for (ShardingSphereMetaData each :
metaDataContexts.getMetaDataMap().values()) {
+ Map<ShardingSphereUser, Collection<ShardingSpherePrivilege>>
privileges = PrivilegeBuilder
+ .build(each.getResource().getAllInstanceDataSources(),
users, loader.get(), maxConnectionsSizePerQuery);
+ result.putAll(PrivilegeMerger.merge(privileges, each.getName(),
each.getRuleMetaData().getRules()));
Review comment:
There is `PrivilegeMerger` in `PrivilegeBuilder`, isn't there?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]