hdygxsj commented on code in PR #7062:
URL: https://github.com/apache/gravitino/pull/7062#discussion_r2063131877
##########
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:
When Configs.ENABLE_AUTHORIZATION is set to true, it will be null because
JcasbinAuthorizer has not been implemented yet. If we don't check for null
before the implementation of JcasbinAuthorizer, a null pointer exception will
occur here.
--
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]