morningman commented on code in PR #16802:
URL: https://github.com/apache/doris/pull/16802#discussion_r1110020231


##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/AccessControllerManager.java:
##########
@@ -51,8 +57,21 @@ private CatalogAccessController 
getAccessControllerOrDefault(String ctl) {
         return ctlToCtlAccessController.getOrDefault(ctl, 
internalAccessController);
     }
 
-    public void addCatalogAccessControl(String ctl, CatalogAccessController 
controller) {
-        ctlToCtlAccessController.put(ctl, controller);
+    public void createAccessController(String ctl, String acFactoryClassName, 
Map<String, String> prop) {
+        Class<?> factoryClazz = null;
+        try {
+            factoryClazz = Class.forName(acFactoryClassName);
+            AccessControllerFactory factory = (AccessControllerFactory) 
factoryClazz.newInstance();
+            CatalogAccessController accessController = 
factory.createAccessController(prop);
+            ctlToCtlAccessController.put(ctl, accessController);
+            LOG.info("create access controller {} for catalog {}", ctl, 
acFactoryClassName);
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeException(e);
+        } catch (InstantiationException e) {
+            throw new RuntimeException(e);
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
     }
 

Review Comment:
   fixed. the access controller will be removed when catalog is dropped



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to