Skip to content

Commit

Permalink
Fix NPE with old Atlas authz
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilbonte21 committed Feb 1, 2024
1 parent d877ae6 commit eee8eac
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.atlas.type.AtlasType;
import org.apache.atlas.type.AtlasTypeRegistry;
import org.apache.atlas.utils.AtlasPerfMetrics;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -92,7 +93,9 @@ public static void verifyAccess(AtlasEntityHeader entityHeader, AtlasPrivilege a

public static void verifyAccessForEvaluator(AtlasEntityHeader entityHeader, AtlasPrivilege action) throws AtlasBaseException {
if (!useAbacAuthorizer) {
AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, action, entityHeader, new AtlasClassification(entityHeader.getClassifications().get(0))));
//AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, action, entityHeader, new AtlasClassification(entityHeader.getClassifications().get(0))));
AtlasClassification classification = CollectionUtils.isNotEmpty(entityHeader.getClassifications()) ? entityHeader.getClassifications().get(0) : null;
AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, action, entityHeader, classification));
} else {
if (StringUtils.isNotEmpty(entityHeader.getGuid())) {
NewAuthorizerUtils.verifyAccess(entityHeader, action);
Expand Down

0 comments on commit eee8eac

Please sign in to comment.