You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2023/03/31 07:18:38 UTC

[ranger] branch master updated: RANGER-4073 : Groups are not visible in mask and row level policy listing tables.

This is an automated email from the ASF dual-hosted git repository.

ni3galave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 000db1cbe RANGER-4073 : Groups are not visible in mask and row level policy listing tables.
000db1cbe is described below

commit 000db1cbeb0f8fed1e02e88edbdc80386023b515
Author: Dhaval Rajpara <dh...@gmail.com>
AuthorDate: Fri Mar 24 09:56:02 2023 +0530

    RANGER-4073 : Groups are not visible in mask and row level policy listing tables.
---
 .../src/main/webapp/scripts/utils/XAUtils.js       |  2 +-
 .../views/policies/NRangerPolicyTableLayout.js     | 25 +++++++----------
 .../views/policies/RangerPolicyTableLayout.js      | 31 ++++++++++------------
 3 files changed, 25 insertions(+), 33 deletions(-)

diff --git a/security-admin/src/main/webapp/scripts/utils/XAUtils.js b/security-admin/src/main/webapp/scripts/utils/XAUtils.js
index b49387817..200fdeab5 100644
--- a/security-admin/src/main/webapp/scripts/utils/XAUtils.js
+++ b/security-admin/src/main/webapp/scripts/utils/XAUtils.js
@@ -497,7 +497,7 @@ define(function(require) {
 		} else
 			return '--';
 	};
-        XAUtils.showGroupsOrUsersForPolicy = function(rawValue, model, showType, rangerServiceDefModel) {
+        XAUtils.showGroupsOrUsersForPolicy = function(model, showType, rangerServiceDefModel) {
 		var showMoreLess = false, groupArr = [], items = [];
 		var itemList = ['policyItems','allowExceptions','denyPolicyItems','denyExceptions','dataMaskPolicyItems','rowFilterPolicyItems']
 		if(!_.isUndefined(rangerServiceDefModel)){
diff --git a/security-admin/src/main/webapp/scripts/views/policies/NRangerPolicyTableLayout.js b/security-admin/src/main/webapp/scripts/views/policies/NRangerPolicyTableLayout.js
index 64f975a99..2da6f02aa 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/NRangerPolicyTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/NRangerPolicyTableLayout.js
@@ -394,28 +394,23 @@ define(function(require) {
                         label: localization.tt("lbl.roles"),
                         formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
                             fromRaw: function(rawValue, model) {
-                                return XAUtil.showGroupsOrUsersForPolicy(model.get('policyItems'), model, 'roles', that.rangerServiceDefModel);
+                                return XAUtil.showGroupsOrUsersForPolicy(model, 'roles', that.rangerServiceDefModel);
                             }
                         }),
                         editable: false,
                         sortable: false
                     },
-                    policyItems: {
-                        reName: 'groupName',
-                        cell: Backgrid.HtmlCell.extend({
-                            className: 'cellWidth-1'
-                        }),
-                        label: localization.tt("lbl.group"),
+                    groups : {
+                        reName : 'groupName',
+                        cell : Backgrid.HtmlCell.extend({className: 'cellWidth-1'}),
+                        label : localization.tt("lbl.group"),
                         formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
-                            fromRaw: function(rawValue, model) {
-                                if (!_.isUndefined(rawValue)) {
-                                    return XAUtil.showGroupsOrUsersForPolicy(rawValue, model, 'groups', that.rangerServiceDefModel);
-                                }
-                                return '--';
+                            fromRaw: function (rawValue, model) {
+                                return XAUtil.showGroupsOrUsersForPolicy(model, 'groups', that.rangerServiceDefModel);
                             }
                         }),
-                        editable: false,
-                        sortable: false
+                        editable : false,
+                        sortable : false
                     },
                     //Hack for backgrid plugin doesn't allow to have same column name 
                     users: {
@@ -426,7 +421,7 @@ define(function(require) {
                         label: localization.tt("lbl.users"),
                         formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
                             fromRaw: function(rawValue, model) {
-                                return XAUtil.showGroupsOrUsersForPolicy(model.get('policyItems'), model, 'users', that.rangerServiceDefModel);
+                                return XAUtil.showGroupsOrUsersForPolicy(model, 'users', that.rangerServiceDefModel);
                             }
                         }),
                         editable: false,
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
index 1facb3737..de2f17df3 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
@@ -356,27 +356,24 @@ define(function(require){
                                         label : localization.tt("lbl.roles"),
                                         formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
                                                 fromRaw: function (rawValue, model) {
-                                                        return XAUtil.showGroupsOrUsersForPolicy(model.get('policyItems'), model, 'roles', that.rangerServiceDefModel);
+                                                        return XAUtil.showGroupsOrUsersForPolicy(model, 'roles', that.rangerServiceDefModel);
                                                 }
                                         }),
                                         editable : false,
                                         sortable : false
                                 },
-				policyItems : {
-					reName : 'groupName',
-					cell	: Backgrid.HtmlCell.extend({className: 'cellWidth-1'}),
-					label : localization.tt("lbl.group"),
-					formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
-						fromRaw: function (rawValue, model) {
-							if(!_.isUndefined(rawValue)){
-                                                                return XAUtil.showGroupsOrUsersForPolicy(rawValue, model, 'groups', that.rangerServiceDefModel);
-							}
-							return '--';
-						}
-					}),
-					editable : false,
-					sortable : false
-				},
+                groups : {
+                    reName : 'groupName',
+                    cell : Backgrid.HtmlCell.extend({className: 'cellWidth-1'}),
+                    label : localization.tt("lbl.group"),
+                    formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+                        fromRaw: function (rawValue, model) {
+                            return XAUtil.showGroupsOrUsersForPolicy(model, 'groups', that.rangerServiceDefModel);
+                        }
+                    }),
+                    editable : false,
+                    sortable : false
+                },
 				//Hack for backgrid plugin doesn't allow to have same column name 
 				users : {
 					reName : 'userName',
@@ -384,7 +381,7 @@ define(function(require){
 					label : localization.tt("lbl.users"),
 					formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
 						fromRaw: function (rawValue, model) {
-                                                                return XAUtil.showGroupsOrUsersForPolicy(model.get('policyItems'), model, 'users', that.rangerServiceDefModel);
+                                                                return XAUtil.showGroupsOrUsersForPolicy(model, 'users', that.rangerServiceDefModel);
                                                 }
                                         }),
                                         editable : false,