VinayakMarraiya230920 commented on code in PR #734:
URL: https://github.com/apache/atlas/pull/734#discussion_r3957415469


##########
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/ClassificationAssociator.java:
##########
@@ -86,14 +96,28 @@ public AtlasEntityHeaders get(long fromTimestamp, long 
toTimestamp) throws Atlas
 
         private AtlasEntityHeader getEntityHeaderByGuid(String guid) {
             try {
-                return 
entityRetriever.toAtlasEntityHeaderWithClassifications(guid);
+                AtlasEntityHeader entityHeader = 
entityRetriever.toAtlasEntityHeaderWithClassifications(guid);
+
+                if (entityHeader == null || 
!isEntityReadAllowed(entityHeader)) {
+                    return null;
+                }
+
+                return entityHeader;
             } catch (AtlasBaseException e) {
                 LOG.error("Error fetching entity: {}", guid, e);
             }
 
             return null;
         }
 
+        private boolean isEntityReadAllowed(AtlasEntityHeader entityHeader) {
+            if (typeRegistry == null) {
+                return true;

Review Comment:
   Thanks [@mneethiraj](https://github.com/mneethiraj) — done. Added 
isEntityReadAllowed() in EntityGraphRetriever and call it from Retriever, so 
typeRegistry is no longer a member here. Updated tests accordingly; all pass. 
cc [@nixonrodrigues](https://github.com/nixonrodrigues)



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