This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 741f233cafb40c0ca798c895f93f34c0880d3780
Author: Sanket-Shelar <[email protected]>
AuthorDate: Wed Feb 7 19:16:52 2024 +0530

    RANGER-4690: updated Hive plugin to fix incorrect policy version in access 
audits in case of deny due to masking/row-filter policies
    
    Signed-off-by: Madhan Neethiraj <[email protected]>
---
 .../ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java      | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
 
b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
index 44c66dfd9..9b25e2b8a 100644
--- 
a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
+++ 
b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
@@ -1068,6 +1068,7 @@ public class RangerHiveAuthorizer extends 
RangerHiveAuthorizerBase {
 
                                                result.setIsAllowed(false);
                                                
result.setPolicyId(rowFilterResult.getPolicyId());
+                                               
result.setPolicyVersion(rowFilterResult.getPolicyVersion());
                                                result.setReason("User does not 
have access to all rows of the table");
                                        } else {
                                                // check if masking is enabled 
for any column in the table/view
@@ -1082,6 +1083,7 @@ public class RangerHiveAuthorizer extends 
RangerHiveAuthorizerBase {
 
                                                        
result.setIsAllowed(false);
                                                        
result.setPolicyId(dataMaskResult.getPolicyId());
+                                                       
result.setPolicyVersion(dataMaskResult.getPolicyVersion());
                                                        result.setReason("User 
does not have access to unmasked column values");
                                                }
                                        }

Reply via email to