Skip to content

Commit

Permalink
Evaluator API fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilbonte21 committed Feb 1, 2024
1 parent eee8eac commit aac4c53
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@ 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))));
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);
if (action == ENTITY_CREATE) {
AuthorizerUtils.verifyAccess(entityHeader, ENTITY_CREATE);
} else {
NewAuthorizerUtils.verifyAccessForEvaluator(entityHeader, action);
if (StringUtils.isNotEmpty(entityHeader.getGuid())) {
NewAuthorizerUtils.verifyAccess(entityHeader, action);
} else {
NewAuthorizerUtils.verifyAccessForEvaluator(entityHeader, action);
}
}
}
}
Expand Down

0 comments on commit aac4c53

Please sign in to comment.