761417898 commented on code in PR #16494:
URL: https://github.com/apache/iotdb/pull/16494#discussion_r2386567954
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/auth/ClusterAuthorityFetcher.java:
##########
@@ -420,13 +422,51 @@ private void onOperatePermissionSuccess(Object plan) {
@Override
public SettableFuture<ConfigTaskResult> operatePermission(AuthorStatement
authorStatement) {
- return operatePermissionInternal(authorStatement, false);
+ return handleAccountUnlock(
+ authorStatement,
+ authorStatement.getUserName(),
+ false,
+ () -> onOperatePermissionSuccess(authorStatement));
}
@Override
public SettableFuture<ConfigTaskResult> operatePermission(
RelationalAuthorStatement authorStatement) {
- return operatePermissionInternal(authorStatement, true);
+ return handleAccountUnlock(
+ authorStatement,
+ authorStatement.getUserName(),
+ true,
+ () -> onOperatePermissionSuccess(authorStatement));
+ }
+
+ private SettableFuture<ConfigTaskResult> handleAccountUnlock(
+ Object authorStatement, String username, boolean isRelational, Runnable
successCallback) {
+
+ if (isUnlockStatement(authorStatement, isRelational)) {
+ SettableFuture<ConfigTaskResult> future = SettableFuture.create();
+ User user = getUser(username);
+ if (user == null) {
+ future.setException(new IoTDBException(String.format("User %s Not
Found", username), 701));
Review Comment:
fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]