zddr commented on code in PR #16091: URL: https://github.com/apache/doris/pull/16091#discussion_r1098308500
########## fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivTable.java: ########## @@ -72,37 +61,29 @@ public boolean hasPriv(String host, String user, PrivPredicate wanted) { * NOTICE, this method does not set password for the newly added entry if this is a user priv table, the caller * need to set password later. */ - public PrivEntry addEntry(PrivEntry newEntry, boolean errOnExist, boolean errOnNonExist) throws DdlException { + public PrivEntry addEntry(PrivEntry newEntry, + boolean errOnExist, boolean errOnNonExist) throws DdlException { PrivEntry existingEntry = getExistingEntry(newEntry); if (existingEntry == null) { if (errOnNonExist) { - throw new DdlException("User " + newEntry.getUserIdent() + " does not exist"); + throw new DdlException("entry does not exist"); } entries.add(newEntry); Collections.sort(entries); LOG.info("add priv entry: {}", newEntry); return newEntry; } else { if (errOnExist) { - throw new DdlException("User already exist"); + throw new DdlException("entry already exist"); } else { - checkOperationAllowed(existingEntry, newEntry, "ADD ENTRY"); - // if existing entry is set by domain resolver, just replace it with the new entry. - // if existing entry is not set by domain resolver, merge the 2 entries. - if (existingEntry.isSetByDomainResolver()) { - existingEntry.setPrivSet(newEntry.getPrivSet()); - existingEntry.setSetByDomainResolver(newEntry.isSetByDomainResolver()); - LOG.debug("reset priv entry: {}", existingEntry); - } else if (!newEntry.isSetByDomainResolver()) { - mergePriv(existingEntry, newEntry); - existingEntry.setSetByDomainResolver(false); - LOG.debug("merge priv entry: {}", existingEntry); - } + mergePriv(existingEntry, newEntry); + LOG.debug("merge priv entry: {}", existingEntry); Review Comment: How to handle domain now? =====================> now,domainUser,ipUser,and resolveUserByDomain all manage By userManager,The logic of scheduled tasks is the same as before -- 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. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org