zhujunxxxxx commented on a change in pull request #10310:
URL: https://github.com/apache/shardingsphere/pull/10310#discussion_r633587443
##########
File path:
shardingsphere-infra/shardingsphere-infra-authority/shardingsphere-infra-authority-common/src/main/java/org/apache/shardingsphere/authority/checker/AuthorityChecker.java
##########
@@ -56,7 +58,28 @@ public SQLCheckResult check(final SQLStatement sqlStatement,
final List<Object>
// TODO add error msg
return privileges.map(optional -> new
SQLCheckResult(optional.hasPrivileges(Collections.singletonList(getPrivilege(sqlStatement))),
"")).orElseGet(() -> new SQLCheckResult(false, ""));
}
-
+
+ @Override
+ public boolean check(final Grantee grantee, final AuthorityRule
authorityRule) {
+ Optional<ShardingSphereUser> user = authorityRule.findUser(grantee);
+ if (!user.isPresent()) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean check(final Grantee grantee, final BiPredicate<Object,
Object> validate, final Object cipher, final AuthorityRule authorityRule) {
Review comment:
> Maybe the first argument of validate is possible to be password rather
thangrantee?
This would be better, but it would cause MySQL and PostgreSQL to be
incompatible. so I extract the password validation rule.
--
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]