ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-ranger git commit: RANGER-1016 : Display resourceType field under the Audit, Access tab
Date Wed, 08 Jun 2016 06:50:56 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master 46b23e54e -> 28439c804


RANGER-1016 : Display resourceType field under the Audit, Access tab

Signed-off-by: Madhan Neethiraj <madhan@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/28439c80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/28439c80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/28439c80

Branch: refs/heads/master
Commit: 28439c804f8895d8d79ca457422841b6fb86a08d
Parents: 46b23e5
Author: Mehul Parikh <mehul.parikh@freestoneinfotech.com>
Authored: Tue Jun 7 20:48:00 2016 +0530
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Tue Jun 7 23:39:35 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/ranger/rest/AssetREST.java  |  2 ++
 .../src/main/webapp/scripts/modules/RestCsrf.js |  4 +--
 .../webapp/scripts/views/reports/AuditLayout.js | 35 +++++++++++---------
 security-admin/src/main/webapp/styles/xa.css    |  3 ++
 4 files changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/28439c80/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java b/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
index 5a6203f..3d649df 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
@@ -639,6 +639,8 @@ public class AssetREST {
 				"Access Type", StringUtil.VALIDATION_TEXT);
 		searchUtil.extractString(request, searchCriteria, "clientIP",
 				"Client IP", StringUtil.VALIDATION_TEXT);
+		searchUtil.extractString(request, searchCriteria, "resourceType",
+				"Resource Type", StringUtil.VALIDATION_TEXT);
 
 		searchUtil.extractInt(request, searchCriteria, "auditType", "Audit Type");
 		searchUtil.extractInt(request, searchCriteria, "accessResult", "Audit Type");

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/28439c80/security-admin/src/main/webapp/scripts/modules/RestCsrf.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/modules/RestCsrf.js b/security-admin/src/main/webapp/scripts/modules/RestCsrf.js
index 2eff355..a2df456 100644
--- a/security-admin/src/main/webapp/scripts/modules/RestCsrf.js
+++ b/security-admin/src/main/webapp/scripts/modules/RestCsrf.js
@@ -23,7 +23,7 @@
 // protection by figuring out the custom HTTP headers that need to be sent in
 // requests and which HTTP methods are ignored because they do not require CSRF
 // protection.
-(function() {
+define(function(require) {
 	"use strict";
 	require('jquery');
 	var restCsrfCustomHeader = null;
@@ -95,4 +95,4 @@
       xhr.setRequestHeader(restCsrfCustomHeader, '""');
     }
   }
-})();
\ No newline at end of file
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/28439c80/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
index 59514b6..023dcc8 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
@@ -167,7 +167,7 @@ define(function(require) {
 					<th class="renderable ruser"></th>\
 					<th class="renderable ruser"></th>\
 					<th class="renderable cip">Service</th>\
-					<th class="renderable name"  ></th>\
+					<th class="renderable name">Resource</th>\
 					<th class="renderable cip"></th>\
 					<th class="renderable cip"></th>\
 					<th class="renderable cip"> </th>\
@@ -262,8 +262,9 @@ define(function(require) {
 			                      {text : 'Access Type',label :'accessType'},{text : 'Access Enforcer',label
:'aclEnforcer'},
 			                      {text : 'Audit Type',label :'auditType'},{text : 'Session ID',label
:'sessionId'},
 			                      {text : 'Client IP',label :'clientIP'},{text : 'Client Type',label
:'clientType'},
-			                      {text : 'Tags',label :'tags'}];
-            var searchOpt = ['Start Date','End Date','User','Service Name','Service Type','Resource
Name','Access Type','Result','Access Enforcer','Client IP','Tags'];//,'Policy ID'
+			                      {text : 'Tags',label :'tags'},
+			                      {text : 'Resource Type',label : 'resourceType'}];
+            var searchOpt = ['Resource Type','Start Date','End Date','User','Service Name','Service
Type','Resource Name','Access Type','Result','Access Enforcer','Client IP','Tags'];//,'Policy
ID'
             this.clearVisualSearch(this.accessAuditList, serverAttrName);
             
 			//'Resource Type','Audit Type','Session IP','Client Type','Today',
@@ -827,19 +828,23 @@ define(function(require) {
 							}
 						})
 					},
-					resourcePath : {
-						label : localization.tt("lbl.resourceName"),
+					resourceType: {
+						label : 'Name / Type',
 						cell: "html",
-						click : false,
-						drag : false,
-						sortable:false,
-						editable:false,
-						formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
-							fromRaw: function (rawValue) {
-								rawValue = _.escape(rawValue);
-								return _.isUndefined(rawValue) ? '--': '<span title="'+rawValue+'">'+rawValue+'</span>';
 
-							}
-						})
+						click: false,
+						formatter: _.extend({},Backgrid.CellFormatter.prototype,{
+							 fromRaw: function(rawValue,model) {
+								 var resourcePath = _.isUndefined(model.get('resourcePath')) ? undefined : model.get('resourcePath');
+								 var resourceType = _.isUndefined(model.get('resourceType')) ? undefined : model.get('resourceType');
+								 if(resourcePath) {
+								 return '<span title="'+resourcePath+'">'+resourcePath+'</span>\
+									<div title="'+resourceType+'" style="border-top: 1px solid #ddd;">'+resourceType+'</div>';
+								 }
+							 }
+						}),
+						drag: false,
+						sortable: false,
+						editable: false,
 					},
 					accessType : {
 						label : localization.tt("lbl.accessType"),

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/28439c80/security-admin/src/main/webapp/styles/xa.css
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/styles/xa.css b/security-admin/src/main/webapp/styles/xa.css
index fb5d80e..5e1981c 100644
--- a/security-admin/src/main/webapp/styles/xa.css
+++ b/security-admin/src/main/webapp/styles/xa.css
@@ -1571,6 +1571,9 @@ background-color: #dc6343;
 table.table.backgrid thead th.repoName { 
  border-top: 1px solid #ddd;
 }
+table.table.backgrid thead th.resourceType {
+ border-top: 1px solid #ddd;
+}
 .label-size13-weightbold{
    font-size: 13px;
    font-weight: bold;


Mime
View raw message