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

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


The following commit(s) were added to refs/heads/master by this push:
     new ff78e621d RANGER-4301: Ranger Access Audit doesn't show callerContext 
in the audit as hover over button for HDFS audits
ff78e621d is described below

commit ff78e621def1e986b939af23cbd2d2948bf5af08
Author: Mugdha Varadkar <[email protected]>
AuthorDate: Fri Jun 16 02:22:06 2023 +0530

    RANGER-4301: Ranger Access Audit doesn't show callerContext in the audit as 
hover over button for HDFS audits
    
    Signed-off-by: Dineshkumar Yadav <[email protected]>
---
 .../src/components/CommonComponents.jsx            |   2 +-
 .../main/webapp/react-webapp/src/styles/style.css  |  28 ++--
 .../main/webapp/react-webapp/src/utils/XAEnums.js  |   9 ++
 .../main/webapp/react-webapp/src/utils/XAUtils.js  |  19 ++-
 .../src/views/AuditEvent/AccessLogs.jsx            | 168 ++++++++-------------
 .../src/views/AuditEvent/AccessLogsTable.jsx       |  41 ++++-
 .../webapp/scripts/modules/globalize/message/en.js |   3 +
 .../src/main/webapp/scripts/utils/XAViewUtils.js   |  74 ++++-----
 .../views/reports/AuditAccessLogDetailView.js      |   7 +-
 .../reports/AuditAccessLogDetail_tmpl.html         |  39 +++++
 10 files changed, 234 insertions(+), 156 deletions(-)

diff --git 
a/security-admin/src/main/webapp/react-webapp/src/components/CommonComponents.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/components/CommonComponents.jsx
index 7fe756c47..890154c62 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/components/CommonComponents.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/components/CommonComponents.jsx
@@ -332,7 +332,7 @@ export const CustomPopoverOnClick = ({
             <Popover.Title>
               {title}
               <i
-                className="pull-right close"
+                className="pull-right close ml-2"
                 onClick={(e) => {
                   e.stopPropagation();
                   handleClick();
diff --git a/security-admin/src/main/webapp/react-webapp/src/styles/style.css 
b/security-admin/src/main/webapp/react-webapp/src/styles/style.css
index 0d54a20e2..37dcab847 100644
--- a/security-admin/src/main/webapp/react-webapp/src/styles/style.css
+++ b/security-admin/src/main/webapp/react-webapp/src/styles/style.css
@@ -671,13 +671,6 @@ table.no-bg-color thead tr th:first-child {
   border-top: 1px solid #ddd;
 }
 
-.resource-text {
-  overflow: hidden;
-  text-overflow: ellipsis;
-  flex: 1;
-  padding-right: 12px;
-}
-
 /* Edit Permission */
 .show-more-less {
   color: #0b7fad;
@@ -1673,11 +1666,28 @@ header {
   color: #000;
   text-shadow: 0 1px 0 #fff;
   opacity: 0.5;
+  cursor: pointer;
+}
+
+.resource-text {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  flex: 1;
+  padding-right: 12px;
 }
 
 .query-icon {
-  padding: 0 4px;
-  margin-top: 9px;
+  padding: 5px;
+  margin: 0;
+}
+
+.query-icon i {
+  display: block;
+  width: 14px;
+}
+
+.lht-2 {
+  line-height: 2;
 }
 
 /* Policy expire icon */
diff --git a/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js 
b/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js
index 29da52dc6..6e5eb0d5b 100644
--- a/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js
+++ b/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js
@@ -799,3 +799,12 @@ export const ResourcesOverrideInfoMsg = {
   project: "Kylin Project Level.",
   "nifi-resource": "NiFi Resource Identifier."
 };
+
+export const ServiceRequestDataRangerAcl = [
+  ServiceType.Service_HIVE.label,
+  ServiceType.Service_HBASE.label,
+  ServiceType.Service_HDFS.label,
+  ServiceType.Service_SOLR.label
+];
+
+export const ServiceRequestDataHadoopAcl = [ServiceType.Service_HDFS.label];
diff --git a/security-admin/src/main/webapp/react-webapp/src/utils/XAUtils.js 
b/security-admin/src/main/webapp/react-webapp/src/utils/XAUtils.js
index 19c600d1a..30fc4225b 100644
--- a/security-admin/src/main/webapp/react-webapp/src/utils/XAUtils.js
+++ b/security-admin/src/main/webapp/react-webapp/src/utils/XAUtils.js
@@ -43,7 +43,7 @@ import CustomBreadcrumb from "../views/CustomBreadcrumb";
 import { CustomTooltip } from "../components/CommonComponents";
 import InfiniteScroll from "react-infinite-scroll-component";
 import { toast } from "react-toastify";
-import { RangerPolicyType } from "./XAEnums";
+import { RangerPolicyType, ServiceType } from "./XAEnums";
 import { policyInfoMessage } from "./XAMessages";
 import { fetchApi } from "Utils/fetchAPI";
 
@@ -1399,3 +1399,20 @@ export const checkKnoxSSO = async (navigate) => {
 export const navigateTo = {
   navigate: null
 };
+
+export const requestDataTitle = (serviceType) => {
+  let title = "";
+  if (serviceType == ServiceType.Service_HIVE.label) {
+    title = `Hive Query`;
+  }
+  if (serviceType == ServiceType.Service_HBASE.label) {
+    title = `HBase Audit Data`;
+  }
+  if (serviceType == ServiceType.Service_HDFS.label) {
+    title = `HDFS Operation Name`;
+  }
+  if (serviceType == ServiceType.Service_SOLR.label) {
+    title = "Solr Query";
+  }
+  return title;
+};
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
index 1b5650432..2a522b89a 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
@@ -53,11 +53,15 @@ import {
   getTableSortBy,
   getTableSortType,
   serverError,
+  requestDataTitle,
   fetchSearchFilterParams,
   parseSearchFilter
 } from "../../utils/XAUtils";
 import { CustomTooltip, Loader } from "../../components/CommonComponents";
-import { ServiceType } from "../../utils/XAEnums";
+import {
+  ServiceRequestDataRangerAcl,
+  ServiceRequestDataHadoopAcl
+} from "../../utils/XAEnums";
 
 function Access() {
   const isKMSRole = isKeyAdmin() || isKMSAuditor();
@@ -281,7 +285,7 @@ function Access() {
     setUpdateTable(moment.now());
   };
 
-  const rsrcContent = (requestData) => {
+  const requestDataContent = (requestData) => {
     const copyText = (val) => {
       !isEmpty(val) && toast.success("Copied successfully!!");
       return val;
@@ -334,24 +338,42 @@ function Access() {
     );
   };
 
-  const rsrctitle = (title) => {
-    let filterTitle = "";
-    if (title == ServiceType.Service_HIVE.label) {
-      filterTitle = `Hive Query`;
-    }
-    if (title == ServiceType.Service_HBASE.label) {
-      filterTitle = `HBase Audit Data`;
-    }
-    if (title == ServiceType.Service_HDFS.label) {
-      filterTitle = `HDFS Operation Name`;
-    }
-    if (title == ServiceType.Service_SOLR.label) {
-      filterTitle = "Solr Query";
+  const showQueryPopup = (rowId, aclEnforcer, serviceType, requestData) => {
+    if (!isEmpty(requestData)) {
+      if (
+        aclEnforcer === "ranger-acl" &&
+        ServiceRequestDataRangerAcl.includes(serviceType)
+      ) {
+        return queryPopupContent(rowId, serviceType, requestData);
+      } else if (
+        aclEnforcer === "hadoop-acl" &&
+        ServiceRequestDataHadoopAcl.includes(serviceType)
+      ) {
+        return queryPopupContent(rowId, serviceType, requestData);
+      } else {
+        return "";
+      }
     }
-    return <strong>{filterTitle}</strong>;
   };
 
-  const previousVer = (e) => {
+  const queryPopupContent = (rowId, serviceType, requestData) => {
+    return (
+      <div className="pull-right">
+        <div className="queryInfo btn btn-sm link-tag query-icon">
+          <CustomPopoverOnClick
+            icon="fa-fw fa fa-table"
+            title={requestDataTitle(serviceType)}
+            content={requestDataContent(requestData)}
+            placement="left"
+            trigger={["click", "focus"]}
+            id={rowId}
+          ></CustomPopoverOnClick>
+        </div>
+      </div>
+    );
+  };
+
+  const previousVersion = (e) => {
     if (e.currentTarget.classList.contains("active")) {
       let curr = policyParamsData && policyParamsData.policyVersion;
       let policyVersionList = currentPage;
@@ -367,7 +389,7 @@ function Access() {
     setPolicyParamsData(prevVal);
   };
 
-  const nextVer = (e) => {
+  const nextVersion = (e) => {
     if (e.currentTarget.classList.contains("active")) {
       let curr = policyParamsData && policyParamsData.policyVersion;
       let policyVersionList = currentPage;
@@ -455,10 +477,13 @@ function Access() {
         Header: "Service (Name / Type)",
         accessor: (s) => (
           <div>
-            <div className="text-left" title={s.repoDisplayName}>
+            <div className="text-left lht-2 mb-1" title={s.repoDisplayName}>
               {s.repoDisplayName}
             </div>
-            <div className="bt-1 text-left" title={s.serviceTypeDisplayName}>
+            <div
+              className="bt-1 text-left lht-2 mb-0"
+              title={s.serviceTypeDisplayName}
+            >
               {s.serviceTypeDisplayName}
             </div>
           </div>
@@ -471,96 +496,34 @@ function Access() {
         Header: "Resource (Name / Type)",
         accessor: "resourceType",
         Cell: (r) => {
+          let rowId = r.row.original.id;
           let resourcePath = r.row.original.resourcePath;
           let resourceType = r.row.original.resourceType;
           let serviceType = r.row.original.serviceType;
           let aclEnforcer = r.row.original.aclEnforcer;
           let requestData = r.row.original.requestData;
-          let id = r.row.original.id;
-          if (
-            (serviceType == ServiceType.Service_HIVE.label ||
-              serviceType == ServiceType.Service_HBASE.label ||
-              serviceType == ServiceType.Service_HDFS.label ||
-              serviceType == ServiceType.Service_SOLR.label) &&
-            aclEnforcer === "ranger-acl" &&
-            !isEmpty(requestData)
-          ) {
-            if (!isUndefined(resourcePath) && !isEmpty(requestData)) {
-              return (
-                <>
+
+          if (!isUndefined(resourcePath)) {
+            let resourcePathText = isEmpty(resourcePath) ? "--" : resourcePath;
+            let resourceTypeText = isEmpty(resourceType) ? "--" : resourceType;
+            return (
+              <React.Fragment>
+                <div className="clearfix d-flex flex-nowrap m-0">
                   <div
-                    className="clearfix"
-                    style={{ display: "flex", flexWrap: "nowrap", margin: "0" 
}}
+                    className="pull-left resource-text lht-2 mb-1"
+                    title={resourcePathText}
                   >
-                    <div
-                      className="pull-left resource-text"
-                      title={resourcePath}
-                    >
-                      {resourcePath}
-                    </div>
-                    <div className="pull-right">
-                      <div className="queryInfo btn btn-sm link-tag 
query-icon">
-                        <CustomPopoverOnClick
-                          icon="fa-fw fa fa-table"
-                          title={rsrctitle(serviceType)}
-                          content={rsrcContent(requestData)}
-                          placement="left"
-                          trigger={["click", "focus"]}
-                          id={id}
-                        ></CustomPopoverOnClick>
-                      </div>
-                    </div>
-                  </div>
-                  <div className="bt-1" title={resourceType}>
-                    {resourceType}
-                  </div>
-                </>
-              );
-            } else {
-              return (
-                <div
-                  className="clearfix"
-                  style={{ display: "flex", flexWrap: "nowrap", margin: "0" }}
-                >
-                  <div className="pull-left resource-text">--</div>
-                  <div className="pull-right">
-                    <div className="queryInfo btn btn-sm link-tag query-icon">
-                      <CustomPopoverOnClick
-                        icon="fa-fw fa fa-table"
-                        title={rsrctitle(serviceType)}
-                        content={rsrcContent(requestData)}
-                        placement="left"
-                        trigger={["click", "focus"]}
-                        id={id}
-                      ></CustomPopoverOnClick>
-                    </div>
+                    {resourcePathText}
                   </div>
+                  {showQueryPopup(rowId, aclEnforcer, serviceType, 
requestData)}
                 </div>
-              );
-            }
+                <div className="bt-1 lht-2 mb-0" title={resourceTypeText}>
+                  {resourceTypeText}
+                </div>
+              </React.Fragment>
+            );
           } else {
-            if (!isUndefined(resourcePath)) {
-              return (
-                <>
-                  <div
-                    className="clearfix"
-                    style={{ display: "flex", flexWrap: "nowrap", margin: "0" 
}}
-                  >
-                    <div
-                      className="pull-left resource-text"
-                      title={resourcePath}
-                    >
-                      {resourcePath}
-                    </div>
-                  </div>
-                  <div className="bt-1" title={resourceType}>
-                    {resourceType}
-                  </div>
-                </>
-              );
-            } else {
-              return <div className="text-center">--</div>;
-            }
+            return <div className="text-center">--</div>;
           }
         },
         minWidth: 180
@@ -1051,7 +1014,8 @@ function Access() {
                     : "fa-fw fa fa-chevron-left"
                 }
                 onClick={(e) =>
-                  e.currentTarget.classList.contains("active") && 
previousVer(e)
+                  e.currentTarget.classList.contains("active") &&
+                  previousVersion(e)
                 }
               ></i>
               <span>{`Version ${
@@ -1071,7 +1035,7 @@ function Access() {
                     : "fa-fw fa fa-chevron-right"
                 }
                 onClick={(e) =>
-                  e.currentTarget.classList.contains("active") && nextVer(e)
+                  e.currentTarget.classList.contains("active") && 
nextVersion(e)
                 }
               ></i>
             </div>
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
index b0c449243..cf92a9a99 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
@@ -22,7 +22,12 @@ import { Button, Table } from "react-bootstrap";
 import dateFormat from "dateformat";
 import { isEmpty } from "lodash";
 import { toast } from "react-toastify";
-import { ServiceType } from "../../utils/XAEnums";
+import {
+  ServiceType,
+  ServiceRequestDataRangerAcl,
+  ServiceRequestDataHadoopAcl
+} from "../../utils/XAEnums";
+import { requestDataTitle } from "../../utils/XAUtils";
 
 export const AccessLogsTable = ({ data = {} }) => {
   const {
@@ -104,14 +109,38 @@ export const AccessLogsTable = ({ data = {} }) => {
           <td>Resource Type</td>
           <td>{!isEmpty(resourceType) ? resourceType : "--"}</td>
         </tr>
-        {(serviceType == ServiceType.Service_HIVE.label ||
-          serviceType == ServiceType.Service_HBASE.label ||
-          serviceType == ServiceType.Service_HDFS.label ||
-          serviceType == ServiceType.Service_SOLR.label) &&
+        {ServiceRequestDataRangerAcl.includes(serviceType) &&
           aclEnforcer === "ranger-acl" &&
           !isEmpty(requestData) && (
             <tr>
-              <td>{serviceType} Query</td>
+              <td>{requestDataTitle(serviceType)}</td>
+              <td>
+                {!isEmpty(requestData) ? (
+                  <>
+                    <Button
+                      className="pull-right link-tag query-icon btn btn-sm"
+                      size="sm"
+                      variant="link"
+                      title="Copy"
+                      onClick={() =>
+                        navigator.clipboard.writeText(copyText(requestData))
+                      }
+                    >
+                      <i className="fa-fw fa fa-copy"> </i>
+                    </Button>
+                    <span>{requestData}</span>
+                  </>
+                ) : (
+                  "--"
+                )}
+              </td>
+            </tr>
+          )}
+        {ServiceRequestDataHadoopAcl.includes(serviceType) &&
+          aclEnforcer === "hadoop-acl" &&
+          !isEmpty(requestData) && (
+            <tr>
+              <td>{requestDataTitle(serviceType)}</td>
               <td>
                 {!isEmpty(requestData) ? (
                   <>
diff --git 
a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js 
b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
index f4a91939e..4caba8f41 100644
--- a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
+++ b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
@@ -283,6 +283,9 @@ define(function(require) {
                 displayName                     : 'Display Name',
                 auditAccessDetail               : 'Audit Access Log Detail',
                 hiveQuery                       : 'Hive Query',
+                hbaseAudit                      : 'HBase Audit Data',
+                solrQuery                       : 'Solr Query',
+                hdfsOperation                   : 'HDFS Operation Name',
                 clientIP                        : 'Client IP',
                 eventCount                      : 'Event Count',
                 tags                            : 'Tags',
diff --git a/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js 
b/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js
index d73a2dfd1..80dd1cc05 100644
--- a/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js
+++ b/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js
@@ -32,18 +32,22 @@ define(function(require) {
         var resourcePath = _.isUndefined(model.get('resourcePath')) ? 
undefined : model.get('resourcePath');
         var resourceType = _.isUndefined(model.get('resourceType')) ? 
undefined : model.get('resourceType');
         if((model.get('serviceType') === 
XAEnums.ServiceType.Service_HIVE.label || model.get('serviceType') === 
XAEnums.ServiceType.Service_HBASE.label || model.get('serviceType') === 
XAEnums.ServiceType.Service_SOLR.label || model.get('serviceType') === 
XAEnums.ServiceType.Service_HDFS.label)
-            && model.get('aclEnforcer') === "ranger-acl"
             && model.get('requestData')){
             if(resourcePath && !_.isEmpty(model.get('requestData'))) {
-                return '<div class="clearfix">\
-                            <div class="pull-left resourceText" title="'+ 
_.escape(resourcePath)+'">'+_.escape(resourcePath)+'</div>\
-                            <div class="pull-right">\
-                                <div class="queryInfo btn btn-sm link-tag 
query-icon" title="Query Info" data-name = "queryInfo" data-id 
="'+model.get('id')+'">\
-                                    <i class="fa-fw fa fa-table" ></i>\
+                if((model.get('serviceType') === 
XAEnums.ServiceType.Service_HDFS.label && model.get('aclEnforcer') === 
"hadoop-acl") || model.get('aclEnforcer') === "ranger-acl"){
+                    return '<div class="clearfix">\
+                                <div class="pull-left resourceText" title="'+ 
_.escape(resourcePath)+'">'+_.escape(resourcePath)+'</div>\
+                                <div class="pull-right">\
+                                    <div class="queryInfo btn btn-sm link-tag 
query-icon" title="Query Info" data-name = "queryInfo" data-id 
="'+model.get('id')+'">\
+                                        <i class="fa-fw fa fa-table" ></i>\
+                                    </div>\
                                 </div>\
                             </div>\
-                        </div>\
-                        <div title="'+_.escape(resourceType)+'" 
class="border-top-1">'+_.escape(resourceType)+'</div>';
+                            <div title="'+_.escape(resourceType)+'" 
class="border-top-1">'+_.escape(resourceType)+'</div>';
+                } else {
+                    return '<div class ="resourceText" 
title="'+_.escape(resourcePath)+'">'+_.escape(resourcePath)+'</div>\
+                            <div title="'+_.escape(resourceType)+'" 
class="border-top-1">'+_.escape(resourceType)+'</div>';
+                }
             }else{
                 return '<div class="clearfix">\
                             <div class="pull-left">--</div>\
@@ -66,34 +70,36 @@ define(function(require) {
 
     XAViewUtil.showQueryPopup = function(model, that){
         if((model.get('serviceType') === 
XAEnums.ServiceType.Service_HIVE.label || model.get('serviceType') === 
XAEnums.ServiceType.Service_HBASE.label || model.get('serviceType') === 
XAEnums.ServiceType.Service_SOLR.label || model.get('serviceType') === 
XAEnums.ServiceType.Service_HDFS.label)
-            && model.get('aclEnforcer') === "ranger-acl"
             && model.get('requestData') && 
!_.isEmpty(model.get('requestData'))){
-            var titleMap = {};
-            titleMap[XAEnums.ServiceType.Service_HIVE.label] = 'Hive Query';
-            titleMap[XAEnums.ServiceType.Service_HBASE.label] = 'HBase Audit 
Data';
-            titleMap[XAEnums.ServiceType.Service_SOLR.label] = 'Solr Query';
-            titleMap[XAEnums.ServiceType.Service_HDFS.label] = 'HDFS Operation 
Name';
-            var msg = '<div class="pull-right link-tag query-icon copyQuery 
btn btn-sm" title="Copy Query"><i class="fa-fw fa fa-copy"></i></div><div 
class="query-content">'+model.get('requestData')+'</div>';
-            var $elements = that.$el.find('table [data-name = 
"queryInfo"][data-id = "'+model.id+'"]');
-            $elements.popover({
-                html: true,
-                title: '<b class="custom-title">'+ 
(titleMap[model.get('serviceType')] || 'Request Data') +'</b><a 
href="javascript:void(0)" class="close popoverClose">&times;</a>',
-                content: msg,
-                selector : true,
-                container:'body',
-                placement: 'top'
-            }).on("click", function(e){
-                e.stopPropagation();
-                $('.popoverClose').on("click", function(){
-                    $(this).parents(".popover").popover('hide');
+            if((model.get('serviceType') === 
XAEnums.ServiceType.Service_HDFS.label && model.get('aclEnforcer') === 
"hadoop-acl") || model.get('aclEnforcer') === "ranger-acl"){
+                var titleMap = {};
+                titleMap[XAEnums.ServiceType.Service_HIVE.label] = 'Hive 
Query';
+                titleMap[XAEnums.ServiceType.Service_HBASE.label] = 'HBase 
Audit Data';
+                titleMap[XAEnums.ServiceType.Service_SOLR.label] = 'Solr 
Query';
+                titleMap[XAEnums.ServiceType.Service_HDFS.label] = 'HDFS 
Operation Name';
+                var msg = '<div class="pull-right link-tag query-icon 
copyQuery btn btn-sm" title="Copy Query"><i class="fa-fw fa 
fa-copy"></i></div><div 
class="query-content">'+model.get('requestData')+'</div>';
+                var $elements = that.$el.find('table [data-name = 
"queryInfo"][data-id = "'+model.id+'"]');
+                $elements.popover({
+                    html: true,
+                    title: '<b class="custom-title">'+ 
(titleMap[model.get('serviceType')] || 'Request Data') +'</b><a 
href="javascript:void(0)" class="close popoverClose">&times;</a>',
+                    content: msg,
+                    selector : true,
+                    container:'body',
+                    placement: 'top'
+                }).on("click", function(e){
+                    e.stopPropagation();
+                    $('.popoverClose').on("click", function(){
+                        $(this).parents(".popover").popover('hide');
+                    });
+                    if($(e.target).data('toggle') !== 'popover' && 
$(e.target).parents('.popover.in').length === 0){
+                        $('.queryInfo').not(this).popover('hide');
+                        $('.copyQuery').on("click", function(e){
+                            XAUtils.copyToClipboard(e , 
model.get('requestData'));
+                        })
+                    }
                 });
-                if($(e.target).data('toggle') !== 'popover' && 
$(e.target).parents('.popover.in').length === 0){
-                    $('.queryInfo').not(this).popover('hide');
-                    $('.copyQuery').on("click", function(e){
-                        XAUtils.copyToClipboard(e , model.get('requestData'));
-                    })
-                }
-            });
+
+            }
         }
     };
 
diff --git 
a/security-admin/src/main/webapp/scripts/views/reports/AuditAccessLogDetailView.js
 
b/security-admin/src/main/webapp/scripts/views/reports/AuditAccessLogDetailView.js
index 16e9ef8a4..2e3a742fd 100644
--- 
a/security-admin/src/main/webapp/scripts/views/reports/AuditAccessLogDetailView.js
+++ 
b/security-admin/src/main/webapp/scripts/views/reports/AuditAccessLogDetailView.js
@@ -54,9 +54,10 @@ define(function(require) {
                     auditaccessDetail : this.auditaccessDetail,
                     eventTime : Globalize.format(new 
Date(this.auditaccessDetail.eventTime),  "MM/dd/yyyy hh:mm:ss tt"),
                     result : result[0].label,
-                    hiveQuery : ((this.auditaccessDetail.serviceType === 
XAEnums.ServiceType.Service_HIVE.label || this.auditaccessDetail.serviceType 
=== XAEnums.ServiceType.Service_HBASE.label) &&
-                                this.auditaccessDetail.aclEnforcer === 
"ranger-acl" && this.auditaccessDetail.requestData) ? true : false,
-
+                    hiveQuery : (this.auditaccessDetail.serviceType === 
XAEnums.ServiceType.Service_HIVE.label && this.auditaccessDetail.aclEnforcer 
=== "ranger-acl" && this.auditaccessDetail.requestData) ? true : false,
+                    hbaseAudit: (this.auditaccessDetail.serviceType === 
XAEnums.ServiceType.Service_HBASE.label && this.auditaccessDetail.aclEnforcer 
=== "ranger-acl" && this.auditaccessDetail.requestData) ? true : false,
+                    solrQuery: (this.auditaccessDetail.serviceType === 
XAEnums.ServiceType.Service_SOLR.label && this.auditaccessDetail.aclEnforcer 
=== "ranger-acl" && this.auditaccessDetail.requestData) ? true : false,
+                    hdfsOperation : (this.auditaccessDetail.serviceType === 
XAEnums.ServiceType.Service_HDFS.label && this.auditaccessDetail.requestData) ? 
true : false,
                     tag : this.tags ? this.tags.join() : undefined,
                     auditAccessView : this.auditAccessView,
                     policyDetailsView : (this.auditAccessView && 
this.auditaccessDetail.policyId !== -1) ? true : false,
diff --git 
a/security-admin/src/main/webapp/templates/reports/AuditAccessLogDetail_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/AuditAccessLogDetail_tmpl.html
index f962b57d0..1d22961d6 100644
--- 
a/security-admin/src/main/webapp/templates/reports/AuditAccessLogDetail_tmpl.html
+++ 
b/security-admin/src/main/webapp/templates/reports/AuditAccessLogDetail_tmpl.html
@@ -135,6 +135,45 @@
                     </td>
                 </tr>
             {{/if}}
+            {{#if hbaseAudit}}
+                <tr>
+                    <td>
+                        {{tt 'lbl.hbaseAudit'}}
+                    </td>
+                    <td>
+                        <span class="pull-right link-tag query-icon copyQuery 
btn btn-sm" data-name="copyQuery" title="Copy Query">
+                            <i class="fa-fw fa fa-copy"></i>
+                        </span>
+                        <span>{{auditaccessDetail.requestData}}</span>
+                    </td>
+                </tr>
+            {{/if}}
+            {{#if solrQuery}}
+                <tr>
+                    <td>
+                        {{tt 'lbl.solrQuery'}}
+                    </td>
+                    <td>
+                        <span class="pull-right link-tag query-icon copyQuery 
btn btn-sm" data-name="copyQuery" title="Copy Query">
+                            <i class="fa-fw fa fa-copy"></i>
+                        </span>
+                        <span>{{auditaccessDetail.requestData}}</span>
+                    </td>
+                </tr>
+            {{/if}}
+            {{#if hdfsOperation}}
+                <tr>
+                    <td>
+                        {{tt 'lbl.hdfsOperation'}}
+                    </td>
+                    <td>
+                        <span class="pull-right link-tag query-icon copyQuery 
btn btn-sm" data-name="copyQuery" title="Copy Query">
+                            <i class="fa-fw fa fa-copy"></i>
+                        </span>
+                        <span>{{auditaccessDetail.requestData}}</span>
+                    </td>
+                </tr>
+            {{/if}}
             <tr>
                 <td>
                     {{tt 'lbl.accessType'}}

Reply via email to