jerryshao commented on code in PR #7062:
URL: https://github.com/apache/gravitino/pull/7062#discussion_r2063027139


##########
server-common/src/main/java/org/apache/gravitino/server/authorization/GravitinoAuthorizerProvider.java:
##########
@@ -40,7 +41,21 @@ private GravitinoAuthorizerProvider() {}
    * @param serverConfig Gravitino server config
    */
   public void initialize(ServerConfig serverConfig) {
-    // TODO
+    if (gravitinoAuthorizer == null) {
+      synchronized (this) {
+        if (gravitinoAuthorizer == null) {
+          boolean enableAuthorization = 
serverConfig.get(Configs.ENABLE_AUTHORIZATION);
+          if (enableAuthorization) {
+            // TODO
+          } else {
+            gravitinoAuthorizer = new IgnoreAuthorizer();
+          }
+          if (gravitinoAuthorizer != null) {

Review Comment:
   In which scenario will the `gravitinoAuthorizer` be null?



##########
server-common/src/main/java/org/apache/gravitino/server/authorization/IgnoreAuthorizer.java:
##########
@@ -15,17 +15,31 @@
  * under the License.
  */
 
-package org.apache.gravitino.server.authorization.annotations;
+package org.apache.gravitino.server.authorization;
 
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.io.IOException;
+import java.security.Principal;
+import org.apache.gravitino.MetadataObject;
+import org.apache.gravitino.authorization.Privilege;
 
 /**
- * This annotation is used to implement unified authentication in AOP. Use 
Expressions to define the
- * required privileges for an API.
+ * The default implementation of GravitinoAuthorizer, indicating that metadata 
permission control is
+ * not enabled.
  */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ExpressionsAuthorizeApi {}
+public class IgnoreAuthorizer implements GravitinoAuthorizer {

Review Comment:
   Can we rename to `NoOpAuthorizer` or `PassThroughAuthorizer`?



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

Reply via email to