ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v..@apache.org
Subject incubator-ranger git commit: RANGER-1281 : Provide option to filter KMS audits in Access Tab
Date Wed, 28 Dec 2016 23:07:39 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master 31701840c -> 001c91155


RANGER-1281 : Provide option to filter KMS audits in Access Tab

Signed-off-by: Velmurugan Periasamy <vel@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/001c9115
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/001c9115
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/001c9115

Branch: refs/heads/master
Commit: 001c91155a9439c26961277e68c355f86f49fec6
Parents: 3170184
Author: Gautam Borad <gautam@apache.org>
Authored: Tue Nov 8 11:26:00 2016 +0530
Committer: Velmurugan Periasamy <vel@apache.org>
Committed: Wed Dec 28 18:07:19 2016 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/ranger/rest/ServiceREST.java    | 6 +++++-
 .../apache/ranger/service/RangerServiceDefServiceBase.java   | 8 +++++++-
 .../src/main/webapp/scripts/views/reports/AuditLayout.js     | 3 ++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/001c9115/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java b/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
index f272ff3..307eb80 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
@@ -414,6 +414,10 @@ public class ServiceREST {
 		PList<RangerServiceDef> paginatedSvcDefs = null;
 
 		SearchFilter filter = searchUtil.getSearchFilter(request, serviceDefService.sortFields);
+		String pageSource= null;
+		pageSource=request.getParameter("pageSource");
+		if(pageSource!=null)
+			filter.setParam("pageSource",pageSource);
 
 		try {
 			if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
@@ -447,7 +451,7 @@ public class ServiceREST {
 		}
 		return ret;
 	}
-
+	
 	@POST
 	@Path("/services")
 	@Produces({ "application/json", "application/xml" })

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/001c9115/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
b/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
index b349768..7fd4f0c 100644
--- a/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
+++ b/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
@@ -535,11 +535,16 @@ public abstract class RangerServiceDefServiceBase<T extends XXServiceDefBase,
V
 		int pageSize = searchFilter.getMaxRows();
 		searchFilter.setStartIndex(0);
 		searchFilter.setMaxRows(Integer.MAX_VALUE);
+	
+		boolean isAuditPage=false;
+		if(searchFilter.getParam("pageSource")!=null){
+			isAuditPage=true;
+		}
 		List<XXServiceDef> xSvcDefList = (List<XXServiceDef>) searchResources(searchFilter,
searchFields, sortFields,
 				retList);
 		List<XXServiceDef> permittedServiceDefs = new ArrayList<XXServiceDef>();
 		for (XXServiceDef xSvcDef : xSvcDefList) {
-			if (bizUtil.hasAccess(xSvcDef, null)) {
+			if (bizUtil.hasAccess(xSvcDef, null) || (bizUtil.isAdmin() && isAuditPage) ) {
 				permittedServiceDefs.add(xSvcDef);
 			}
 		}
@@ -549,6 +554,7 @@ public abstract class RangerServiceDefServiceBase<T extends XXServiceDefBase,
V
 		return retList;
 
 	}
+	
 
 	private void populatePageList(List<XXServiceDef> xxObjList, int startIndex, int pageSize,
 			RangerServiceDefList retList) {

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/001c9115/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 0cfbf77..51082c0 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
@@ -128,7 +128,8 @@ define(function(require) {
 			this.serviceDefList	= new RangerServiceDefList();
 			this.serviceDefList.fetch({ 
 				cache : false,
-				async:false
+				async:false,
+				data :{'pageSource':'Audit'}
 			});
 			return this.serviceDefList;
 		},


Mime
View raw message