ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ab...@apache.org
Subject [1/2] ranger git commit: RANGER-2008: Policy evaluation is failing for multiline policy conditions.
Date Thu, 27 Sep 2018 00:23:52 GMT
Repository: ranger
Updated Branches:
  refs/heads/ranger-0.7 508d347bc -> 92bdc78f3


RANGER-2008: Policy evaluation is failing for multiline policy conditions.

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/3d430201
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/3d430201
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/3d430201

Branch: refs/heads/ranger-0.7
Commit: 3d430201d2e90708da3bae8ee0034f32e1c925f7
Parents: 508d347
Author: ni3galave <nitin.galave@gmail.com>
Authored: Tue Mar 6 15:10:49 2018 +0530
Committer: Abhay Kulkarni <akulkarni@hortonworks.com>
Committed: Wed Sep 26 16:58:44 2018 -0700

----------------------------------------------------------------------
 .../webapp/scripts/views/policies/PermissionList.js  | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/3d430201/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js b/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
index c4aad36..9184675 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
@@ -530,7 +530,7 @@ define(function(require) {
 					emptytext : 'Add Conditions',
 					value : this.conditions,
 					display: function(value) {
-						var continue_ = false, i = 0;
+						var continue_ = false, i = 0, cond = [];
 						if(!value) {
 							$(this).empty();
 							return; 
@@ -545,19 +545,18 @@ define(function(require) {
 									return ''; 
 								}
 								//Add label for policy condition
-								var pcond = _.findWhere(that.multiLinecond, { 'name': name})
+								var pcond = _.findWhere(that.multiLinecond, { 'name': name});
 								if(!_.isUndefined(pcond) && !_.isUndefined(pcond['evaluatorOptions']) 
 										&& ! _.isUndefined(pcond['evaluatorOptions']["ui.isMultiline"]) 
 										&& ! _.isUndefined(pcond['evaluatorOptions']['engineName'])){
-									val = 	pcond['evaluatorOptions']['engineName'] + ' Condition'
+									cond.push({ 'type' : name, 'values' : !_.isArray(val) ? [val] : val });
+									val = 	pcond['evaluatorOptions']['engineName'] + ' Condition';
+								} else {
+									cond.push({ 'type' : name, 'values' : !_.isArray(val) ?  val.split(',') : val });
 								}
 								i++;
-                                                                return '<span class="'+label+'
white-space-normal" >'+name+' : '+ _.escape(val) + '</span>';
+                                return '<span class="'+label+' white-space-normal" >'+name+'
: '+ _.escape(val) + '</span>';
 							});
-							var cond = _.map(value, function(val, name) {
-                                                                return {'type' : name, 'values'
: !_.isArray(val) ?  val.split(',') : val};
-							});
-							
 							that.model.set('conditions', cond);
 							$(this).html(html);
 							that.ui.addConditionsSpan.find('i').attr('class', 'icon-pencil');


Mime
View raw message