luozenglin commented on a change in pull request #4899:
URL: https://github.com/apache/incubator-doris/pull/4899#discussion_r522895569
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PaloAuth.java
##########
@@ -1300,6 +1301,120 @@ public TFetchResourceResult toResourceThrift() {
}
}
+ // Used for transforming privileges in palo to mysql.
+ private final String[] privilegesInMysql = new String[]{"", "", "",
"SELECT", "INSERT", "ALTER",
+ "CREATE", "DROP", "USAGE"};
+
+ // Used for creating table_privileges table in information_schema.
+ public void getTablePrivStatus(List<TPrivilegeStatus> tblPrivResult,
UserIdentity currentUser) {
+ readLock();
+ try {
+ for (PrivEntry entry : tablePrivTable.getEntries()) {
+ TablePrivEntry tblPrivEntry = (TablePrivEntry) entry;
+ String dbName =
ClusterNamespace.getNameFromFullName(tblPrivEntry.getOrigDb());
+ String tblName = tblPrivEntry.getOrigTbl();
+
+ if (dbName.equals("information_schema" /* Don't show
privileges in information_schema */)
+ || !checkTblPriv(currentUser,
tblPrivEntry.getOrigDb(), tblName, PrivPredicate.SHOW)) {
+ continue;
+ }
+
+ String grantee = new
String("\'").concat(ClusterNamespace.getNameFromFullName(tblPrivEntry.getOrigUser()))
+
.concat("\'@\'").concat(tblPrivEntry.getOrigHost()).concat("\'");
+ String isGrantable = tblPrivEntry.getPrivSet().get(2) ? "yes"
: "no"; //Grant_priv
Review comment:
Should use uppercase, I will modify it.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]