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 988f31c  RANGER-2568: Ranger Hive policy creation page in Ranger Admin 
UI shows resources as Database,None instead of Database,Table,Column
988f31c is described below

commit 988f31ce174ca1df3b5949cc8e952af5ff10a00f
Author: Nitin Galave <[email protected]>
AuthorDate: Fri Sep 13 17:36:52 2019 +0530

    RANGER-2568: Ranger Hive policy creation page in Ranger Admin UI shows 
resources as Database,None instead of Database,Table,Column
---
 .../src/main/webapp/scripts/models/BackboneFormDataType.js   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js 
b/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js
index 1ae2aef..73b807b 100644
--- a/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js
+++ b/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js
@@ -145,7 +145,11 @@ define(function(require) {
                                                                //show only 
required resources in acccess policy in order to show their access types
                                                                
if(!_.isUndefined(v.parent) && !_.isEmpty(v.parent)
                                                                                
&& parentResource.isValidLeaf){
-                                                                       
optionsAttrs.unshift({'level':v.level, name:'none',label:'none'});
+                                                                        
if(form.model && form.model.isNew()) {
+                                                                               
 optionsAttrs.push({'level':v.level, name:'none',label:'none'});
+                                                                        } else 
{
+                                                                               
 optionsAttrs.unshift({'level':v.level, name:'none',label:'none'});
+                                                                        }
                                                                }
                                                                
if(optionsAttrs.length > 1){
                                                                        var 
optionsTitle = _.map(optionsAttrs,function(field){ return field.name;});
@@ -228,7 +232,11 @@ define(function(require) {
                                                                 //show only 
required resources in acccess policy in order to show their access types
                                                                 
if(!_.isUndefined(v.parent) && !_.isEmpty(v.parent)
                                                                                
 && parentResource.isValidLeaf){
-                                                                        
optionsAttrs.unshift({'level':v.level, name:'none',label:'none'});
+                                                                    
if(form.model && form.model.isNew()) {
+                                                                        
optionsAttrs.push({'level':v.level, name:'none',label:'none'});
+                                                                    } else {
+                                                                       
optionsAttrs.unshift({'level':v.level, name:'none',label:'none'});
+                                                                    }
                                                                 }
                                                                 
if(optionsAttrs.length > 1){
                                                                         var 
optionsTitle = _.map(optionsAttrs,function(field){ return field.name;});

Reply via email to