Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
Expand All @@ -19,7 +19,7 @@
import org.apache.hadoop.ozone.om.exceptions.OMException;

/**
* Default implementation for {@link IAccessAuthorizer}.
* No-op implementation for {@link IAccessAuthorizer}, allows everything.
* */
public class OzoneAccessAuthorizer implements IAccessAuthorizer {

Expand All @@ -35,4 +35,9 @@ public boolean checkAccess(IOzoneObj ozoneObject, RequestContext context)
throws OMException {
return true;
}

@Override
public boolean isNative() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,13 @@ private void instantiateServices(boolean withNewSnapshot) throws IOException {
prefixManager = new PrefixManagerImpl(this, metadataManager, isRatisEnabled);
keyManager = new KeyManagerImpl(this, scmClient, configuration,
perfMetrics);
accessAuthorizer = OzoneAuthorizerFactory.forOM(this);
// If authorizer is not initialized or the authorizer is Native
// re-initialize the authorizer, else for non-native authorizer
// like ranger we can reuse previous value if it is initialized
if (null == accessAuthorizer || accessAuthorizer.isNative()) {
accessAuthorizer = OzoneAuthorizerFactory.forOM(this);
}

omMetadataReader = new OmMetadataReader(keyManager, prefixManager,
this, LOG, AUDIT, metrics, accessAuthorizer);
// Active DB's OmMetadataReader instance does not need to be reference
Expand Down