ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@apache.org
Subject [4/5] ranger git commit: RANGER-2003: On Report page 'User, Group and Access' details are not shown for policyItem exceeding more than 25 policies
Date Wed, 07 Mar 2018 06:40:55 GMT
RANGER-2003: On Report page 'User, Group and Access' details are not shown for policyItem exceeding
more than 25 policies

Signed-off-by: pradeep <pradeep@apache.org>


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

Branch: refs/heads/ranger-1.0
Commit: e4828e4eee1fb51b866cc7e8c0f6ddfe46151626
Parents: 58d1fa4
Author: ni3galave <nitin.galave@gmail.com>
Authored: Thu Mar 1 13:53:12 2018 +0530
Committer: pradeep <pradeep@apache.org>
Committed: Wed Mar 7 11:30:56 2018 +0530

----------------------------------------------------------------------
 .../scripts/views/reports/UserAccessLayout.js   | 51 ++++++++++++--------
 1 file changed, 30 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/e4828e4e/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
index db64ee6..95ee3c7 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
@@ -122,15 +122,20 @@ define(function(require) {'use strict';
 				var collName = serviceDefName +'PolicyList';
 				this[collName] = new RangerPolicyList();
 				this.defaultPageState = this[collName].state;
-				this.policyCollList.push({ 'collName' : collName, 'serviceDefName' : serviceDefName})
+				this.policyCollList.push({ 'collName' : collName, 'serviceDefName' : serviceDefName});
+				//set subgrid coll for policy item on pagination
+				this.listenTo(this[collName],'change',function(model){
+					this.setSubgridCollForPolicyItems(model);			
+				});
 			},this);
+			
 		},
 		initializeServiceDef : function() {
-			   this.serviceDefList = new RangerServiceDefList();
-			   this.serviceDefList.fetch({
-				   cache : false,
-				   async:false
-			   });
+		   this.serviceDefList = new RangerServiceDefList();
+		   this.serviceDefList.fetch({
+			   cache : false,
+			   async:false
+		   });
 		},	   
 
 		/** all events binding here */
@@ -185,21 +190,7 @@ define(function(require) {'use strict';
 				if(coll.length >= 1 && !that.allowDownload)
 					that.allowDownload = true;
 				_.each(that[collName].models,function(model,ind){
-					if (XAUtil.isMaskingPolicy(model.get('policyType'))) {
-						//'<name>Collection' must be same as subgrid custom column name
-                                                model.attributes.maskCollection = model.get('dataMaskPolicyItems');
-//						Add service type in masking condition
-                                                _.each(model.attributes.dataMaskPolicyItems
, function(m){
-                                                        m.type = model.collection.queryParams.serviceType;
-                                                })
-					} else if (XAUtil.isRowFilterPolicy(model.get('policyType'))) {
-                                                model.attributes.rowlvlCollection = model.get('rowFilterPolicyItems');
-					} else {
-						model.attributes.allowCollection = model.get('policyItems');
-					}
-					model.attributes.denyCollection  = model.get('denyPolicyItems');
-					model.attributes.denyExcludeCollection    = model.get('denyExceptions');
-					model.attributes.allowExcludeCollection = model.get('allowExceptions');
+					that.setSubgridCollForPolicyItems(model);
 				});
 
 			});
@@ -928,6 +919,24 @@ define(function(require) {'use strict';
 				}, 1100);
 			}
 		},
+		
+		setSubgridCollForPolicyItems: function(model){
+			if (XAUtil.isMaskingPolicy(model.get('policyType'))) {
+				//'<name>Collection' must be same as subgrid custom column name
+                model.attributes.maskCollection = model.get('dataMaskPolicyItems');
+                //Add service type in masking condition
+                _.each(model.attributes.dataMaskPolicyItems , function(m){
+                    m.type = model.collection.queryParams.serviceType;
+                })
+			} else if (XAUtil.isRowFilterPolicy(model.get('policyType'))) {
+                model.attributes.rowlvlCollection = model.get('rowFilterPolicyItems');
+			} else {
+				model.attributes.allowCollection = model.get('policyItems');
+			}
+			model.attributes.denyCollection  = model.get('denyPolicyItems');
+			model.attributes.denyExcludeCollection    = model.get('denyExceptions');
+			model.attributes.allowExcludeCollection = model.get('allowExceptions');
+		},
 		onShowMorePermissions: function(e){
 						var policyId = $(e.currentTarget).attr('policy-id');
 						var $td = $(e.currentTarget).parents('td');


Mime
View raw message