tristaZero commented on a change in pull request #9743:
URL: https://github.com/apache/shardingsphere/pull/9743#discussion_r598402761
##########
File path:
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/auth/model/privilege/ShardingSpherePrivilege.java
##########
@@ -63,6 +63,20 @@ public boolean hasPrivileges(final String schema, final
Collection<PrivilegeType
return hasPrivileges(privileges) ||
databasePrivilege.hasPrivileges(schema, privileges);
}
+ /**
+ * Has privilege for login and use db.
+ *
+ * @param schema schema
+ * @return has or not
+ */
+ public boolean hasPrivileges(final String schema) {
+ if
(administrativePrivilege.getPrivileges().contains(PrivilegeType.SUPER) ||
!databasePrivilege.getGlobalPrivileges().isEmpty()
+ ||
databasePrivilege.getSpecificPrivileges().containsKey(schema)) {
+ return true;
Review comment:
return
administrativePrivilege.getPrivileges().contains(PrivilegeType.SUPER) ||
!databasePrivilege.getGlobalPrivileges().isEmpty()
||
databasePrivilege.getSpecificPrivileges().containsKey(schema)
--
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]