RANGER-2003: On Report page 'User, Group and Access' details are not shown for 
policyItem exceeding more than 25 policies

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


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

Branch: refs/heads/master
Commit: 06bf91715310915cc5e124ead572c4ee866b59d3
Parents: 2109fe0
Author: ni3galave <nitin.gal...@gmail.com>
Authored: Thu Mar 1 13:53:12 2018 +0530
Committer: pradeep <prad...@apache.org>
Committed: Wed Mar 7 09:21:04 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/06bf9171/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');

Reply via email to