Repository: ranger
Updated Branches:
  refs/heads/master 24579e084 -> bd40d5028


RANGER-2030 : Difference view (Audit->Admin tab) support for policy validity 
period fields

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

Branch: refs/heads/master
Commit: bd40d5028f82eabc01615414f29262af22e89074
Parents: 24579e0
Author: ni3galave <nitin.gal...@gmail.com>
Authored: Tue Apr 17 16:08:34 2018 +0530
Committer: pradeep <prad...@apache.org>
Committed: Thu Apr 19 09:34:46 2018 +0530

----------------------------------------------------------------------
 .../views/reports/OperationDiffDetail.js        | 150 +-------------
 .../views/reports/PlugableServiceDiffDetail.js  | 109 +++++-----
 .../KnoxPolicyDeleteOperationDiff_tmpl.html     | 118 -----------
 .../reports/KnoxPolicyOperationDiff_tmpl.html   | 119 -----------
 .../KnoxPolicyUpdateOperationDiff_tmpl.html     | 207 -------------------
 .../PlugableServicePolicyDeleteDiff_tmpl.html   |  34 +++
 .../reports/PlugableServicePolicyDiff_tmpl.html |  34 ++-
 .../PlugableServicePolicyUpdateDiff_tmpl.html   |  70 +++++++
 .../reports/PolicyDeleteOperationDiff_tmpl.html | 104 ----------
 .../reports/PolicyOperationDiff_tmpl.html       | 105 ----------
 .../reports/PolicyUpdateOperationDiff_tmpl.html | 163 ---------------
 11 files changed, 187 insertions(+), 1026 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js 
b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
index 5d929c1..e9ce7d4 100644
--- 
a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
+++ 
b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
@@ -24,12 +24,6 @@ define(function(require){
        var Backbone                                            = 
require('backbone');
        var XAEnums                                                     = 
require('utils/XAEnums');
        var XALinks                                                     = 
require('modules/XALinks');
-       var PolicyOperationDiff_tmpl            = 
require('hbs!tmpl/reports/PolicyOperationDiff_tmpl');
-       var PolicyUpdateOperationDiff_tmpl      = 
require('hbs!tmpl/reports/PolicyUpdateOperationDiff_tmpl');
-       var PolicyDeleteUpdateOperationDiff_tmpl        = 
require('hbs!tmpl/reports/PolicyDeleteOperationDiff_tmpl');
-       var KnoxPolicyOperationDiff_tmpl                        = 
require('hbs!tmpl/reports/KnoxPolicyOperationDiff_tmpl');
-       var KnoxPolicyUpdateOperationDiff_tmpl          = 
require('hbs!tmpl/reports/KnoxPolicyUpdateOperationDiff_tmpl');
-       var KnoxPolicyDeleteUpdateOperationDiff_tmpl= 
require('hbs!tmpl/reports/KnoxPolicyDeleteOperationDiff_tmpl');
        var AssetOperationDiff_tmpl             = 
require('hbs!tmpl/reports/AssetOperationDiff_tmpl');
        var AssetUpdateOperationDiff_tmpl       = 
require('hbs!tmpl/reports/AssetUpdateOperationDiff_tmpl');
        var UserOperationDiff_tmpl                      = 
require('hbs!tmpl/reports/UserOperationDiff_tmpl');
@@ -42,7 +36,6 @@ define(function(require){
        {
                _viewName : 'OperationDiffDetail',
                
-       template: PolicyOperationDiff_tmpl,
         templateHelpers :function(){
                var obj = {
                                collection : this.collection.models,
@@ -146,17 +139,6 @@ define(function(require){
                                }
                                this.assetDiffOperation();
                        }
-                       if(this.classType == 
XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value){
-                               
this.templateType=XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value;
-                               if(this.action == 'create'){
-                                       this.template = 
PolicyOperationDiff_tmpl;
-                               } else if(this.action == 'update'){
-                                       this.template = 
PolicyUpdateOperationDiff_tmpl;
-                               } else{
-                                       this.template = 
PolicyDeleteUpdateOperationDiff_tmpl;
-                               }
-                               this.resourceDiffOperation();
-                       } 
                        if(this.classType == 
XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value
                                        || this.classType == 
XAEnums.ClassTypes.CLASS_TYPE_USER_PROFILE.value
                                        || this.classType == 
XAEnums.ClassTypes.CLASS_TYPE_PASSWORD_CHANGE.value){
@@ -216,137 +198,7 @@ define(function(require){
                        }
                        
                },
-               resourceDiffOperation : function(){
-                       var that = this, modelColl = [];
-                       this.newGroupPermList = [],this.previousGroupPermList = 
[], this.newUserPermList = [],this.previousUserPermList = [], this.isGroupPerm 
= false, this.isUserPerm = false;
-                       this.userList = [],this.groupList = [];
-                       this.collection.each(function(m){
-                               var attrName = m.get('attributeName'), type = 
'permType';
-                               if(attrName == "IP Address")    type = 
'ipAddress';
-                               if(m.get('attributeName') == 'Permission Type' 
|| m.get('attributeName') == "IP Address"){
-                                       if(m.get('parentObjectClassType') == 
XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value){
-                                               if(m.get('action') != 'delete'){
-                                                       if(m.get('action') == 
'create'){
-                                                               var obj = 
{groupName : m.get('parentObjectName')};
-                                                               obj[type] = ""; 
-                                                               
that.previousGroupPermList.push(obj);
-                                                       }
-                                                       obj = {groupName : 
m.get('parentObjectName')};
-                                                       obj[type] = 
m.get('newValue');
-                                                       
that.newGroupPermList.push(obj);
-                                               }
-                                               if(m.get('action') == 'delete' 
|| m.get('action') == 'update'){
-                                                       obj = {groupName : 
m.get('parentObjectName')};
-                                                       obj[type] = 
m.get('previousValue');
-                                                       
that.previousGroupPermList.push(obj);
-                                               }
-                                               
if($.inArray(m.get('parentObjectName'),that.groupList) < 0)
-                                                       
that.groupList.push(m.get('parentObjectName'));
-                                       } else {
-                                               if(m.get('action') != 'delete'){
-                                                       if(m.get('action') == 
'create'){
-                                                               var obj = 
{userName : m.get('parentObjectName')};
-                                                               obj[type] = ""; 
-                                                               
that.previousUserPermList.push(obj);
-                                                       }
-                                                       obj = {userName : 
m.get('parentObjectName')};
-                                                       obj[type] = 
m.get('newValue');
-                                                       
that.newUserPermList.push(obj);
-                                               }
-                                               if(m.get('action') == 'delete' 
|| m.get('action') == 'update'){
-                                                       obj = {userName : 
m.get('parentObjectName')};
-                                                       obj[type] = 
m.get('previousValue');
-                                                       
that.previousUserPermList.push(obj);
-                                               }
-                                               
-                                               
-                                               
if($.inArray(m.get('parentObjectName'),that.userList) < 0)
-                                                       
that.userList.push(m.get('parentObjectName'));
-                                       }
-                                       modelColl.push(m);
-                                       
-                               } else if(m.get('attributeName') == 'Repository 
Type'){
-                                       if(m.get('action') != 'delete'){
-                                               that.repositoryType = 
m.get('newValue');
-                                       } else {
-                                               that.repositoryType = 
m.get('previousValue');
-                                       }
-                                       modelColl.push(m);
-                                       if(that.repositoryType == 
XAEnums.AssetType.ASSET_KNOX.label && m.get('action') == 
"create")//XAEnums.AssetType.ASSET_KNOX.value)
-                                               that.template = 
KnoxPolicyOperationDiff_tmpl;
-                                       if(that.repositoryType == 
XAEnums.AssetType.ASSET_KNOX.label && m.get('action') == "update")
-                                               that.template = 
KnoxPolicyUpdateOperationDiff_tmpl;
-                                       if(that.repositoryType == 
XAEnums.AssetType.ASSET_KNOX.label && m.get('action') == "delete")
-                                               that.template = 
KnoxPolicyDeleteUpdateOperationDiff_tmpl;
-                               } else if(m.get('attributeName') == 'Policy 
Name'){
-                                       if(m.get('action') != 'delete'){
-                                               that.policyName = 
m.get('newValue');
-                                       } else {
-                                               that.policyName = 
m.get('previousValue');
-                                       }
-                                       if(m.get('newValue') == 
m.get('previousValue'))
-                                               modelColl.push(m);
-                               }
-                       
-                               if(_.isUndefined(m.get('attributeName')))
-                                       modelColl.push(m);
-                       });
-                       
-                       this.newGroupPermList           = 
_.groupBy(this.newGroupPermList, 'groupName');
-                       this.previousGroupPermList      = 
_.groupBy(this.previousGroupPermList, 'groupName');
-                       this.newUserPermList                    = 
_.groupBy(this.newUserPermList, 'userName');
-                       this.previousUserPermList                       = 
_.groupBy(this.previousUserPermList, 'userName');
-                       
-                       this.removeUnwantedElement();
-                       this.createEqualLengthArr();
-                       
-                       if(!_.isEmpty(this.newGroupPermList) || 
!_.isEmpty(this.previousGroupPermList))
-                               this.isGroupPerm = true;
-                       if(!_.isEmpty(this.newUserPermList) || 
!_.isEmpty(this.previousUserPermList))
-                               this.isUserPerm = true;
-                       
-                       that.collection.remove(modelColl);
-               },
-               removeUnwantedElement : function(){
-                       var that = this;
-                       _.each(this.newGroupPermList,function(val,key){
-                               console.log(val);
-                               that.newGroupPermList[key]      = 
_.uniq(val,false,function(m){return m.permType;});
-                       });
-                       _.each(this.previousGroupPermList,function(val,key){
-                               console.log(val);
-                               that.previousGroupPermList[key] = 
_.uniq(val,false,function(m){return m.permType;});
-                       });
-                       _.each(this.newUserPermList,function(val,key){
-                               console.log(val);
-                               that.newUserPermList[key]       = 
_.uniq(val,false,function(m){return m.permType;});
-                       });
-                       _.each(this.previousUserPermList,function(val,key){
-                               console.log(val);
-                               that.previousUserPermList[key]  = 
_.uniq(val,false,function(m){return m.permType;});
-                       });
-                       
-               },
-               createEqualLengthArr : function(){
-                       if(this.objectSize(this.previousGroupPermList) > 
this.objectSize(this.newGroupPermList)){
-                               var addlength = 
this.objectSize(this.previousGroupPermList) - 
this.objectSize(this.newGroupPermList);
-                               for(var i=0; i < addlength; i++)
-                                       this.newGroupPermList['temp'+i] = [];
-                       }else{
-                               var addlength = 
this.objectSize(this.newGroupPermList) - 
this.objectSize(this.previousGroupPermList);
-                               for(var i=0; i < addlength; i++)
-                                       this.previousGroupPermList['temp'+i] = 
[];
-                       }
-                       if(this.objectSize(this.previousUserPermList) > 
this.objectSize(this.newUserPermList)){
-                               var addlength = 
this.objectSize(this.previousUserPermList) - 
this.objectSize(this.newUserPermList);
-                               for(var i=0; i < addlength; i++)
-                                       this.newUserPermList['temp'+i] = [];
-                       }else{
-                               var addlength = 
this.objectSize(this.newUserPermList) - 
this.objectSize(this.previousUserPermList);
-                               for(var i=0; i < addlength; i++)
-                                       this.previousUserPermList['temp'+i] = 
[];
-                       }
-               },
+
                userDiffOperation : function(){
                        var that = this, modelArr = [];
                        this.groupList = [], this.newGroupList = [], 
this.previousGroupList =[],this.isGroup = false;

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
 
b/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
index 99e1778..3df0ec4 100644
--- 
a/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
+++ 
b/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
@@ -32,7 +32,6 @@ define(function(require){
        var PolicyOperationDiff_tmpl            = 
require('hbs!tmpl/reports/PlugableServicePolicyDiff_tmpl');
        var PolicyUpdateOperationDiff_tmpl      = 
require('hbs!tmpl/reports/PlugableServicePolicyUpdateDiff_tmpl');
        var PolicyDeleteOperationDiff_tmpl      = 
require('hbs!tmpl/reports/PlugableServicePolicyDeleteDiff_tmpl');
-       var PolicyDeleteUpdateOperationDiff_tmpl        = 
require('hbs!tmpl/reports/PolicyDeleteOperationDiff_tmpl');
        
        var PlugableServiceDiffDetail = Backbone.Marionette.ItemView.extend(
        /** @lends PlugableServiceDiffDetail */
@@ -64,6 +63,8 @@ define(function(require){
                                        oldMaskPolicyItems: 
this.oldMaskPolicyItems,
                                        oldRowFilterPolicyItems: 
this.oldRowFilterPolicyItems,
                                        userName   : this.userName,
+                                       newPolicyValidityPeriod: 
this.newValidityPeriod,
+                                       oldPolicyValidityPeriod: 
this.oldValidityPeriod
 
                        };
         },
@@ -119,8 +120,8 @@ define(function(require){
                /** on render callback */
                onRender: function() {
                        this.initializePlugins();
-                       
this.removeLastCommaFromSpans(this.$el.find('.policyDetail').find('ol li'))
-                       this.removeLastCommaFromSpans(this.ui.diff.find('ol 
li'))
+                       
this.removeLastCommaFromSpans(this.$el.find('.policyDetail').find('ol li'));
+                       this.removeLastCommaFromSpans(this.ui.diff.find('ol 
li'));
                        
                        _.each(this.ui.policyDiff.find('ol li'),function(m){
                                if(_.isEmpty($(m).text().trim()))
@@ -129,18 +130,26 @@ define(function(require){
                        //Remove last br from ol
                        
this.$el.find('.diff-perms').find('.diff-right').find('ol:last').next().remove()
                        
this.$el.find('.diff-perms').find('.diff-left').find('ol:last').next().remove()
+                       
this.$el.find('.validityPeriod').find('.diff-right').find('ol:last').next().remove()
+            
this.$el.find('.validityPeriod').find('.diff-left').find('ol:last').next().remove()
                        
                        var newOl = 
this.$el.find('.diff-perms').find('.diff-right').find('ol');
                        var oldOl = 
this.$el.find('.diff-perms').find('.diff-left').find('ol');
+            var newTimeOl = 
this.$el.find('.validityPeriod').find('.diff-right').find('ol');
+            var oldTimeOl = 
this.$el.find('.validityPeriod').find('.diff-left').find('ol');
                        
                        _.each(oldOl, function(ol, i) {
-                               console.log()
                                this.highLightElement($(ol).find('.username'), 
$(newOl[i]).find('.username'));
                                this.highLightElement($(ol).find('.groupname'), 
$(newOl[i]).find('.groupname'));
                                this.highLightElement($(ol).find('.perm'), 
$(newOl[i]).find('.perm'));
                                this.highLightElement($(ol).find('.condition'), 
$(newOl[i]).find('.condition'));
                                
this.highLightElement($(ol).find('.maskingAndRow'), 
$(newOl[i]).find('.maskingAndRow'));
-                               
+                       },this);
+
+            _.each(oldTimeOl, function(ol, i){
+                this.highLightElement($(ol).find('.startTime'), 
$(newTimeOl[i]).find('.startTime'));
+                this.highLightElement($(ol).find('.endTime'), 
$(newTimeOl[i]).find('.endTime'));
+                this.highLightElement($(ol).find('.timeZone'), 
$(newTimeOl[i]).find('.timeZone'));
                        },this);
                },
                removeLastCommaFromSpans : function($el) {
@@ -208,6 +217,14 @@ define(function(require){
                        if(!_.isUndefined(policyResource)){
                                this.getPolicyResources();
                        }
+            var policyValiditySchedules = 
this.collection.findWhere({'attributeName':'Validity Schedules'});
+            if(!_.isUndefined(policyValiditySchedules)){
+                var validityPeriod = this.getPolicyValiditySchedules('Validity 
Schedules');
+                if(!_.isEmpty(validityPeriod)){
+                    this.newValidityPeriod = validityPeriod.newPerms;
+                    this.oldValidityPeriod = validityPeriod.oldPerms;
+                }
+            }
                        var policyItems = 
this.collection.findWhere({'attributeName':'Policy Items'});
                        if(!_.isUndefined(policyItems)){
                                var perms = this.getPolicyItems('Policy Items');
@@ -275,7 +292,7 @@ define(function(require){
                                var oldResources = {} ;
                                var resourceNewValues = 
JSON.parse(policyResources.get('previousValue'));
                                ////for resource  old value
-                               _.each(resourceNewValues,function(val,key){ 
+                               _.each(resourceNewValues,function(val,key){
                                        oldResources[key] = 
val.values.toString();
                                        oldResources[key +' exclude'] = 
val.isExcludes.toString();
                                        oldResources[key +' recursive'] = 
val.isRecursive.toString();
@@ -284,14 +301,14 @@ define(function(require){
                        if(this.action == "update"){
                                //**Show diffview data for resource change at 
same level.
                                var done = false;
-                               _.each(resources,function(val, key){
+                               _.each(resources, function(val, key){
                                        if(_.isUndefined(oldResources[key] && 
!done)){
                                                
_.each(resources,function(val,key){
                                                        
if(!oldResources.hasOwnProperty(key)){
                                                                
oldResources[key] = "";
                                                        }
                                                });
-                                               
_.each(oldResources,function(val,key){
+                                               _.each(oldResources, 
function(val,key){
                                                        
if(!resources.hasOwnProperty(key)){
                                                                resources[key] 
= "";
                                                        }
@@ -299,16 +316,34 @@ define(function(require){
                                                done = true;
                                        }
                                });
-                               _.each(resources,function(val, key){ 
-                                       if(val != oldResources[key])
-                                               
this.collection.add({'attributeName':key, 
'newValue':val.toString(),'previousValue': oldResources[key],type : "Policy 
Resources"}); 
-                               }, this)
+                       _.each(resources, function(val, key){
+                               if(val != oldResources[key])
+                                       
this.collection.add({'attributeName':key, 
'newValue':val.toString(),'previousValue': oldResources[key],type : "Policy 
Resources"});
+                       }, this);
                        } else if(this.action == "create"){
-                               _.each(resources,function(val, key){ 
this.collection.add({'attributeName':key, 'newValue':val.toString()}); }, this)
+                               _.each(resources,function(val, key){ 
this.collection.add({'attributeName':key, 'newValue':val.toString()}); }, this);
                        } else{
-                               _.each(oldResources,function(val, key){ 
this.collection.add({'attributeName':key, 'previousValue':val.toString()}); }, 
this)
+                               _.each(oldResources,function(val, key){ 
this.collection.add({'attributeName':key, 'previousValue':val.toString()}); }, 
this);
                        }
                },
+        getPolicyValiditySchedules : function(){
+            var validityPeriod = {},that = this;
+            var validityTime=[], oldValidityTime =[];
+            var validitySchedules = 
this.collection.findWhere({'attributeName':'Validity Schedules'});
+            this.collection.remove(validitySchedules);
+            if(!_.isUndefined(validitySchedules.get('newValue')) && 
!_.isEmpty(validitySchedules.get('newValue'))){
+                var validityTimeNewValues = 
JSON.parse(validitySchedules.get('newValue'));
+            }
+            if(!_.isUndefined(validitySchedules.get('previousValue')) && 
!_.isEmpty(validitySchedules.get('previousValue'))){
+                var oldvalidityTime = {} ;
+                var validityTimePreviousValue = 
JSON.parse(validitySchedules.get('previousValue'));
+            }
+            if(this.action == "update"){
+                return this.setOldNewPermDiff(validityTimeNewValues, 
validityTimePreviousValue);
+            } else {
+                return {'oldPerms' : validityTimePreviousValue, 'newPerms' : 
validityTimeNewValues};
+            }
+        },
                getPolicyItems : function(itemType) {
                        var items = {},that = this;
                        var newPolicyItems=[], oldPolicyItems =[];
@@ -357,15 +392,10 @@ define(function(require){
                                        }
                        }
 
-//                     this.oldPermList =[], this.newPermList =[]
                        if(this.action == "update"){
-                               //return 
this.setOldeNewPermList(newPolicyItems, oldPolicyItems);
                                return this.setOldNewPermDiff(newPolicyItems, 
oldPolicyItems);
                        } else {
-                               
                                return {'oldPerms' : oldPolicyItems, 'newPerms' 
: newPolicyItems};
-//                             this.oldPermList = this.oldPolicyItems;
-//                             this.newPermList = this.newPolicyItems; 
                        }
                },
                setOldNewPermDiff: function(newPolicyItems, oldPolicyItems){
@@ -379,47 +409,6 @@ define(function(require){
                        }
                        return {'newPerms': newPerms, 'oldPerms': oldPerms};
                },
-               setOldeNewPermList : function(newPolicyItems, oldPolicyItems) {
-                       var found = false, oldPerms = [], newPerms = [];
-                       for(var i=0; i< newPolicyItems.length ;i++){
-                               found = false;
-                               for(var j=0; j< oldPolicyItems.length ;j++){
-                                       if(!found)
-                                               
if(_.intersection(oldPolicyItems[j].users,newPolicyItems[i].users).length > 0
-                                                               || 
_.intersection(oldPolicyItems[j].groups,newPolicyItems[i].groups).length > 0){
-                                                       
if(JSON.stringify(newPolicyItems[i]) != JSON.stringify(oldPolicyItems[j])){
-                                                               
oldPerms.push(oldPolicyItems[j]);
-                                                               
newPerms.push(newPolicyItems[i]);
-                                                       }
-                                                       found = true;
-                                               }
-                               }
-                               if(!found){
-                                       oldPerms.push({});
-                                       newPerms.push(newPolicyItems[i]);
-                               }
-                       }
-                       for(var i=0; i< oldPolicyItems.length ;i++){
-                               found = false;
-                               for(var j=0; j < newPolicyItems.length;j++){
-                                       if(!found && 
_.intersection(oldPolicyItems[i].users,newPolicyItems[j].users).length > 0
-                                                       || 
_.intersection(oldPolicyItems[i].groups,newPolicyItems[j].groups).length > 0){
-                                               
if(JSON.stringify(oldPolicyItems[i]) != JSON.stringify(newPolicyItems[j])){
-                                                       
if($.inArray(oldPolicyItems[i], oldPerms) < 0){
-                                                               
oldPerms.push(oldPolicyItems[i]);
-                                                               
newPerms.push(newPolicyItems[j]);
-                                                       }
-                                               }
-                                               found = true;
-                                       }
-                               }
-                               if(!found){
-                                       oldPerms.push(oldPolicyItems[i]);
-                                       newPerms.push({});
-                               }
-                       }
-                       return {'newPerms' : newPerms, 'oldPerms' : oldPerms };
-               },
                /** all post render plugin initialization */
                initializePlugins: function(){
                },

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
deleted file mode 100644
index 901a1df..0000000
--- 
a/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
+++ /dev/null
@@ -1,118 +0,0 @@
-{{!-- 
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---}}
-<label class="no-margin label-size13-weightbold">Policy Name : 
{{policyName}}</label>
-{{#if repositoryType}}
-       <label class="no-margin label-size13-weightbold">Repository Type : 
{{repositoryType}}</label>
-{{/if}}
-<label class="no-margin label-size13-weightbold"> Date  &nbsp;&nbsp;:  
{{objectCreatedDate}}</label>
-<label class="no-margin label-size13-weightbold" > Deleted By  &nbsp;&nbsp;:  
{{userName}}</label>
-
-{{#if collection.length}}
-       <h5>Policy Details :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Fields</h3>
-                       <ol class="attr">
-                       {{#each collection}}
-                               <li 
class="change-row">{{./this.attributes.attributeName}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-                <div class="diff-left" >
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.previousValue}}
-                                       {{#compare 
./this.attributes.previousValue "eq" ''}}
-                                                       <li>--</li>             
-                                       {{else}}
-                                                       <li 
class="change-row">{{./this.attributes.previousValue}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                               <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-               </div> 
-       </div>
-{{/if}}        
-{{#if isGroupPerm}}    
-       <h5>Group Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Groups</h3>
-                       <ol class="attr">
-                       {{#eachProperty previousGroupPermList}}
-                                       <li class="change-row">{{property}}</li>
-                       {{/eachProperty }}      
-                       </ol>
-               </div>
-               <div class="diff-left" data-id="diff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty previousGroupPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{#if permType}}
-                                                               {{permType}} 
-                                                               <span>,</span>
-                                                       {{/if}} 
-                                               {{/each}}
-                                               {{#each value}}
-                                                       {{#if ipAddress}}
-                                                               IP : 
{{ipAddress}} 
-                                                       {{/if}} 
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isUserPerm}}
-       <h5>User Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left" >
-                       <h3>Users</h3>
-                       <ol class="attr">
-                               {{#eachProperty previousUserPermList}}
-                                       <li class="change-row">{{property}}</li>
-                               {{/eachProperty }}      
-                       </ol>
-               </div>
-       
-               <div class="diff-left" data-id="diff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty previousUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{#if permType}}
-                                                               {{permType}} 
-                                                               <span>,</span>
-                                                       {{/if}} 
-                                               {{/each}}
-                                               {{#each value}}
-                                                       {{#if ipAddress}}
-                                                               IP : 
{{ipAddress}} 
-                                                       {{/if}} 
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div> 
-{{/if}}        

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
deleted file mode 100644
index d93fcdb..0000000
--- 
a/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
+++ /dev/null
@@ -1,119 +0,0 @@
-{{!-- 
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---}}
-<div class="diff-content">
-       <label class="no-margin label-size13-weightbold">Policy Name : 
{{policyName}}</label>
-       {{#if repositoryType}}
-               <label class="no-margin label-size13-weightbold">Repository 
Type : {{repositoryType}}</label>
-       {{/if}}
-       <label class="no-margin label-size13-weightbold"> Date  &nbsp;&nbsp;:  
{{objectCreatedDate}}</label>
-       <label class="no-margin label-size13-weightbold" > Created By  
&nbsp;&nbsp;:  {{userName}}</label>
-
-{{#if collection.length}}
-       <h5>Policy Details :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Fields</h3>
-                       <ol class="attr">
-                       {{#each collection}}
-                               <li 
class="change-row">{{./this.attributes.attributeName}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-               <div class="diff-right">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.newValue}}
-                                       {{#compare ./this.attributes.newValue 
"eq" ''}}
-                                               <li>--</li>             
-                                       {{else}}
-                                               <li 
class="change-row">{{./this.attributes.newValue}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                       <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-                       </ol>
-               </div>
-       </div>
-{{/if}}        
-{{#if isGroupPerm}}    
-       <h5>Group Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Groups</h3>
-                       <ol class="attr">
-                       {{#eachProperty newGroupPermList}}
-                                       <li class="change-row">{{property}}</li>
-                       {{/eachProperty }}      
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newGroupPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{#if permType}}
-                                                               
{{permType}}<span>,</span>
-                                                       {{/if}} 
-                                               {{/each}}
-                                               {{#each value}}
-                                                       {{#if ipAddress}}
-                                                               IP : 
{{ipAddress}}
-                                                       {{/if}} 
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isUserPerm}}
-       <h5>User Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Users</h3>
-                       <ol class="attr">
-                               {{#eachProperty newUserPermList}}
-                                       <li class="change-row">{{property}}</li>
-                               {{/eachProperty }}      
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{#if permType}}
-                                                               
{{permType}}<span>,</span>
-                                                       {{/if}} 
-                                               {{/each}}
-                                               {{#each value}}
-                                                       {{#if ipAddress}}
-                                                               IP : 
{{ipAddress}}
-                                                       {{/if}} 
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div> 
-{{/if}}        
-
-</div>

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
deleted file mode 100644
index 3cbde7a..0000000
--- 
a/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
+++ /dev/null
@@ -1,207 +0,0 @@
-{{!-- 
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---}}
-<div class="diff-content">
-       <div class="row-fluid">
-               <div class="span6">
-                       <label class="no-margin label-size13-weightbold">Policy 
Name : {{policyName}}</label>
-                       {{#if repositoryType}}
-                               <label class="no-margin 
label-size13-weightbold">Repository Type : {{repositoryType}}</label>
-                       {{/if}}
-                       <label class="no-margin label-size13-weightbold"> Date  
&nbsp;&nbsp;:  {{objectCreatedDate}}</label>
-                       <label class="no-margin label-size13-weightbold" > 
Updated By  &nbsp;&nbsp;:  {{userName}}</label>
-               </div>  
-               <div class="span6 text-right">
-                       <div class="add-text legend"></div> Added
-                       <div class="delete-text legend"></div> Deleted
-               </div>
-       </div>
-{{#if collection.length}}
-       <h5>Policy Details :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Fields</h3>
-                       <ol class="attr">
-                       {{#each collection}}
-                               <li 
class="change-row">{{./this.attributes.attributeName}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-           <div class="diff-left">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.previousValue}}
-                                       {{#compare 
./this.attributes.previousValue "eq" ''}}
-                                                       <li>--</li>             
-                                       {{else}}
-                                                       <li 
class="change-row">{{{highlightNewForAttr ./this.attributes.newValue 
./this.attributes.previousValue 'old'}}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                               <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-                       </ol>
-               </div> 
-               <div class="diff-right">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.newValue}}
-                                       {{#compare ./this.attributes.newValue 
"eq" ''}}
-                                               <li>--</li>             
-                                       {{else}}
-                                               <li 
class="change-row">{{{highlightNewForAttr ./this.attributes.newValue 
./this.attributes.previousValue 'new'}}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                       <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isGroupPerm}}    
-       <h5>Group Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Groups</h3>
-                       <ol class="attr">
-                       {{#each groupList}}
-                                       <li class="change-row">{{./this}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-               <div class="diff-left" data-id="diff" data-name="policyDiff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                                       {{#eachProperty previousGroupPermList}}
-                                               <li class="change-row">
-                                                       {{#each value}}
-                                                               {{#if permType}}
-                                                                       
{{#compare permType "eq" ''}}
-                                                                       
-                                                                       {{else}}
-                                                                               
{{{highlightPermissionsForGroup ../this ../../../property 
../../../../newGroupPermList 'old'}}}
-                                                                               
<span>,</span> 
-                                                                       
{{/compare}}
-                                                               {{/if}} 
-                                                       {{/each}}
-                                                       {{#each value}}
-                                                               {{#if 
ipAddress}}
-                                                                       
{{#compare ipAddress "eq" ''}}
-                                                                       
-                                                                       {{else}}
-                                                                               
IP : {{{highlightPermissionsForGroup ../this ../../../property 
../../../../newGroupPermList 'old'}}}
-                                                                               
<span>,</span> 
-                                                                       
{{/compare}}
-                                                               {{/if}} 
-                                                       {{/each}}
-                                               </li>
-                                       {{/eachProperty }}
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff" data-name="policyDiff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newGroupPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       <!-- {{permType}}, -->
-                                                       {{#if permType}}
-                                                               
{{{highlightPermissionsForGroup ./this ../property 
../../../previousGroupPermList 'new'}}}
-                                                               <span>,</span> 
-                                                       {{/if}}
-                                               {{/each}}
-                                               {{#each value}}
-                                                       <!-- {{permType}}, -->
-                                                       {{#if ipAddress}}
-                                                               IP : 
{{{highlightPermissionsForGroup ./this ../property 
../../../previousGroupPermList 'new'}}}
-                                                               <span>,</span> 
-                                                       {{/if}}
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isUserPerm}}
-       <h5>User Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Users</h3>
-                       <ol class="attr">
-                               {{#each userList}}
-                                       <li class="change-row">{{./this}}</li>
-                               {{/each }}      
-                       </ol>
-               </div>
-               <div class="diff-left" data-id="diff" data-name="policyDiff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty previousUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{#if permType}}
-                                                               {{#compare 
permType "eq" ''}}
-                                                                       
-                                                               {{else}}
-                                                                       
{{{highlightPermissionsForUser ../this ../../property 
../../../../newUserPermList 'old'}}}
-                                                                       
<span>,</span> 
-                                                               {{/compare}}
-                                                       {{/if}} 
-                                               {{/each}}
-                                               {{#each value}}
-                                                       {{#if ipAddress}}
-                                                               {{#compare 
permType "eq" ''}}
-                                                                       
-                                                               {{else}}
-                                                                       IP : 
{{{highlightPermissionsForUser ../this ../../property 
../../../../newUserPermList 'old'}}}
-                                                                       
<span>,</span> 
-                                                               {{/compare}}
-                                                       {{/if}} 
-                                               {{/each}}
-                                       </li>
-                               {{/eachProperty }}
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff" data-name="policyDiff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{#if permType}}
-                                                               <!-- 
{{permType}}, -->
-                                                               
{{{highlightPermissionsForUser ./this ../property ../../../previousUserPermList 
'new'}}}
-                                                               <span>,</span>
-                                                       {{/if}}
-                                               {{/each}}
-                                               {{#each value}}
-                                                       {{#if ipAddress}}
-                                                               <!-- 
{{permType}}, -->
-                                                                IP : 
{{{highlightPermissionsForUser ./this ../property ../../../previousUserPermList 
'new'}}}
-                                                               <span>,</span>
-                                                       {{/if}}
-                                               {{/each}}
-                               </li>
-                               {{/eachProperty}}
-                       </ol>
-               </div>
-       </div> 
-{{/if}}        
-</div>

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
index 97ad345..04aa6dc 100644
--- 
a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
+++ 
b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
@@ -42,6 +42,40 @@
        </div>
 {{/if}}        
 
+{{#if oldPolicyValidityPeriod}}
+    <h5>Validity Period :</h5>
+    <div class="diff validityPeriod" >
+        <div class="diff-right diff-list" data-id="diff">
+            <h3>Old Value</h3>
+            {{#each oldPolicyValidityPeriod}}
+                <ol class="unstyled data">
+                    <li class="change-row"><i>Start Date</i>:
+                        {{#if this.startTime}}
+                            <span 
class="startTime">{{this.startTime}}</span><span>,</span>
+                        {{else}}
+                            --
+                        {{/if}}
+                    </li>
+                    <li class="change-row"><i>End Date</i>:
+                        {{#if this.endTime}}
+                            <span 
class="endTime">{{this.endTime}}</span><span>,</span>
+                        {{else}}
+                            --
+                        {{/if}}
+                    </li>
+                    <li class="change-row"><i>Time Zone</i>:
+                        {{#if this.timeZone}}
+                            <span 
class="timeZone">{{this.timeZone}}</span><span>,</span>
+                        {{else}}
+                            --
+                        {{/if}}
+                    </li>
+                </ol><br/>
+            {{/each}}
+        </div>
+    </div>
+{{/if}}
+
 {{#if oldPolicyItems}}
        <h5>Allow PolicyItems :</h5>
        <div class="diff diff-perms">

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDiff_tmpl.html
index 75c1f64..dbc519a 100644
--- 
a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDiff_tmpl.html
+++ 
b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDiff_tmpl.html
@@ -44,7 +44,39 @@
                </div>
        </div>
 {{/if}}        
-
+{{#if newPolicyValidityPeriod}}
+    <h5>Validity Period :</h5>
+    <div class="diff diff-perms" >
+        <div class="diff-right diff-list" data-id="diff">
+            <h3>New Value</h3>
+            {{#each newPolicyValidityPeriod}}
+                <ol class="unstyled data">
+                    <li class="change-row">Start Date:
+                        {{#if this.startTime}}
+                            {{this.startTime}}
+                        {{else}}
+                            --
+                        {{/if}}
+                    </li>
+                    <li class="change-row">End Date:
+                        {{#if this.endTime}}
+                            {{this.endTime}}
+                        {{else}}
+                            --
+                        {{/if}}
+                    </li>
+                    <li class="change-row">Time Zone:
+                        {{#if this.timeZone}}
+                            {{this.timeZone}}
+                        {{else}}
+                            --
+                        {{/if}}
+                    </li>
+                </ol><br/>
+            {{/each}}
+        </div>
+    </div>
+{{/if}}
 {{#if newPolicyItems}}
        <h5>Allow PolicyItems :</h5>
        <div class="diff diff-perms" >

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
index cac71d9..e150c32 100644
--- 
a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
+++ 
b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
@@ -69,6 +69,76 @@
        </div>
 {{/if}}
 
+{{#if oldPolicyValidityPeriod}}
+    <h5>Validity Period :</h5>
+    <div class="diff validityPeriod" >
+        <div class="diff-left diff-list" data-id="diff">
+            <h3>Old Value</h3>
+            {{#each oldPolicyValidityPeriod}}
+                <ol class="unstyled data">
+                    {{#ifCond this.startTime '||' this.endTime }}
+                        <li class="change-row"><i>Start Date</i>:
+                            {{#if this.startTime}}
+                                <span 
class="startTime">{{this.startTime}}</span><span>,</span>
+                            {{else}}
+                                 --
+                            {{/if}}
+                        </li>
+                        <li class="change-row"><i>End Date</i>:
+                            {{#if this.endTime}}
+                                <span 
class="endTime">{{this.endTime}}</span><span>,</span>
+                            {{else}}
+                               --
+                            {{/if}}
+                        </li>
+                        <li class="change-row"><i>Time Zone</i>:
+                            {{#if this.timeZone}}
+                                <span 
class="timeZone">{{this.timeZone}}</span><span>,</span>
+                            {{else}}
+                               --
+                            {{/if}}
+                        </li>
+                    {{else}}
+                        <li style=" min-height: 71px; line-height: 75px; 
text-align: center; font-weight: bold; font-style: italic;">&lt;empty&gt;</li>
+                    {{/ifCond}}
+                </ol><br/>
+            {{/each}}
+        </div>
+        <div class="diff-right diff-list" data-id="diff">
+            <h3>New Value</h3>
+            {{#each newPolicyValidityPeriod}}
+                <ol class="unstyled data">
+                    {{#ifCond this.startTime '||' this.endTime }}
+                        <li class="change-row"><i>Start Date</i>:
+                            {{#if this.startTime}}
+                                <span 
class="startTime">{{this.startTime}}</span><span>,</span>
+                            {{else}}
+                               --
+                            {{/if}}
+                        </li>
+                        <li class="change-row"><i>End Date</i>:
+                            {{#if this.endTime}}
+                                <span 
class="endTime">{{this.endTime}}</span><span>,</span>
+                            {{else}}
+                               --
+                            {{/if}}
+                        </li>
+                        <li class="change-row"><i>Time Zone</i>:
+                            {{#if this.timeZone}}
+                                <span 
class="timeZone">{{this.timeZone}}</span><span>,</span>
+                            {{else}}
+                               --
+                            {{/if}}
+                        </li>
+                    {{else}}
+                        <li style=" min-height: 71px; line-height: 75px; 
text-align: center; font-weight: bold; font-style: italic;">&lt;empty&gt;</li>
+                    {{/ifCond}}
+                </ol><br/>
+            {{/each}}
+        </div>
+    </div>
+{{/if}}
+
 {{#if oldPolicyItems}}
        <h5>Allow PolicyItems :</h5>
        <div class="diff diff-perms">

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
deleted file mode 100644
index eb37c0b..0000000
--- 
a/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
+++ /dev/null
@@ -1,104 +0,0 @@
-{{!-- 
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---}}
-<label class="no-margin label-size13-weightbold">Policy Name : 
{{policyName}}</label>
-{{#if repositoryType}}
-       <label class="no-margin label-size13-weightbold">Repository Type : 
{{repositoryType}}</label>
-{{/if}}
-<label class="no-margin label-size13-weightbold"> Date  &nbsp;&nbsp;:  
{{objectCreatedDate}}</label>
-<label class="no-margin label-size13-weightbold" > Deleted By  &nbsp;&nbsp;:  
{{userName}}</label>
-
-{{#if collection.length}}
-       <h5>Policy Details :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Fields</h3>
-                       <ol class="attr">
-                       {{#each collection}}
-                               <li 
class="change-row">{{./this.attributes.attributeName}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-                <div class="diff-left" >
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.previousValue}}
-                                       {{#compare 
./this.attributes.previousValue "eq" ''}}
-                                                       <li>--</li>             
-                                       {{else}}
-                                                       <li 
class="change-row">{{./this.attributes.previousValue}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                               <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-               </div> 
-       </div>
-{{/if}}        
-{{#if isGroupPerm}}    
-       <h5>Group Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Groups</h3>
-                       <ol class="attr">
-                       {{#eachProperty previousGroupPermList}}
-                                       <li class="change-row">{{property}}</li>
-                       {{/eachProperty }}      
-                       </ol>
-               </div>
-               <div class="diff-left" data-id="diff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty previousGroupPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{permType}} 
-                                                       <span>,</span>
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isUserPerm}}
-       <h5>User Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left" >
-                       <h3>Users</h3>
-                       <ol class="attr">
-                               {{#eachProperty previousUserPermList}}
-                                       <li class="change-row">{{property}}</li>
-                               {{/eachProperty }}      
-                       </ol>
-               </div>
-       
-               <div class="diff-left" data-id="diff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty previousUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{permType}} 
-                                                       <span>,</span>
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div> 
-{{/if}}        

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
deleted file mode 100644
index a943813..0000000
--- 
a/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
+++ /dev/null
@@ -1,105 +0,0 @@
-{{!-- 
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---}}
-<div class="diff-content">
-       <label class="no-margin label-size13-weightbold">Policy Name : 
{{policyName}}</label>
-       {{#if repositoryType}}
-               <label class="no-margin label-size13-weightbold">Repository 
Type : {{repositoryType}}</label>
-       {{/if}}
-       <label class="no-margin label-size13-weightbold"> Date  &nbsp;&nbsp;:  
{{objectCreatedDate}}</label>
-       <label class="no-margin label-size13-weightbold" > Created By  
&nbsp;&nbsp;:  {{userName}}</label>
-
-{{#if collection.length}}
-       <h5>Policy Details :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Fields</h3>
-                       <ol class="attr">
-                       {{#each collection}}
-                               <li 
class="change-row">{{./this.attributes.attributeName}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-               <div class="diff-right">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.newValue}}
-                                       {{#compare ./this.attributes.newValue 
"eq" ''}}
-                                               <li>--</li>             
-                                       {{else}}
-                                               <li 
class="change-row">{{./this.attributes.newValue}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                       <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-                       </ol>
-               </div>
-       </div>
-{{/if}}        
-{{#if isGroupPerm}}    
-       <h5>Group Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Groups</h3>
-                       <ol class="attr">
-                       {{#eachProperty newGroupPermList}}
-                                       <li class="change-row">{{property}}</li>
-                       {{/eachProperty }}      
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newGroupPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{permType}} 
<span>,</span>
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isUserPerm}}
-       <h5>User Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Users</h3>
-                       <ol class="attr">
-                               {{#eachProperty newUserPermList}}
-                                       <li class="change-row">{{property}}</li>
-                               {{/eachProperty }}      
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       {{permType}} 
<span>,</span>
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div> 
-{{/if}}        
-
-</div>

http://git-wip-us.apache.org/repos/asf/ranger/blob/bd40d502/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
 
b/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
deleted file mode 100644
index 58b9efa..0000000
--- 
a/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
+++ /dev/null
@@ -1,163 +0,0 @@
-{{!-- 
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---}}
-<div class="diff-content">
-       <div class="row-fluid">
-               <div class="span6">
-                       <label class="no-margin label-size13-weightbold">Policy 
Name : {{policyName}}</label>
-                       {{#if repositoryType}}
-                               <label class="no-margin 
label-size13-weightbold">Repository Type : {{repositoryType}}</label>
-                       {{/if}}
-                       <label class="no-margin label-size13-weightbold"> Date  
&nbsp;&nbsp;:  {{objectCreatedDate}}</label>
-                       <label class="no-margin label-size13-weightbold" > 
Updated By  &nbsp;&nbsp;:  {{userName}}</label>
-               </div>  
-               <div class="span6 text-right">
-                       <div class="add-text legend"></div> Added
-                       <div class="delete-text legend"></div> Deleted
-               </div>
-       </div>
-{{#if collection.length}}
-       <h5>Policy Details :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Fields</h3>
-                       <ol class="attr">
-                       {{#each collection}}
-                               <li 
class="change-row">{{./this.attributes.attributeName}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-           <div class="diff-left">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.previousValue}}
-                                       {{#compare 
./this.attributes.previousValue "eq" ''}}
-                                                       <li>--</li>             
-                                       {{else}}
-                                                       <li 
class="change-row">{{{highlightNewForObj ./this.attributes.newValue 
./this.attributes.previousValue 'old'}}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                               <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-                       </ol>
-               </div> 
-               <div class="diff-right">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                       {{#each collection}}
-                               {{#if ./this.attributes.newValue}}
-                                       {{#compare ./this.attributes.newValue 
"eq" ''}}
-                                               <li>--</li>             
-                                       {{else}}
-                                               <li 
class="change-row">{{{highlightNewForObj ./this.attributes.newValue 
./this.attributes.previousValue 'new'}}}</li>
-                                       {{/compare}}
-                               {{else}}
-                                       <li>--</li>
-                               {{/if}}         
-                       {{/each}}       
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isGroupPerm}}    
-       <h5>Group Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Groups</h3>
-                       <ol class="attr">
-                       {{#each groupList}}
-                                       <li class="change-row">{{./this}}</li>
-                       {{/each}}       
-                       </ol>
-               </div>
-               <div class="diff-left" data-id="diff" data-name="policyDiff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                                       {{#eachProperty previousGroupPermList}}
-                                               <li class="change-row">
-                                                       {{#each value}}
-                                                               {{#compare 
permType "eq" ''}}
-                                                                       
-                                                               {{else}}
-                                                                       
{{{highlightPermissionsForGroup ../this ../../property 
../../../newGroupPermList 'old'}}}
-                                                                       
<span>,</span> 
-                                                               {{/compare}}
-                                                       {{/each}}
-                                               </li>
-                                       {{/eachProperty }}
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff" data-name="policyDiff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newGroupPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                       
{{{highlightPermissionsForGroup ./this ../property ../../previousGroupPermList 
'new'}}}
-                                                       <span>,</span> 
-                                               {{/each}}
-                               </li>
-                       {{/eachProperty }}
-                       </ol>
-               </div>
-       </div>
-{{/if}}
-{{#if isUserPerm}}
-       <h5>User Permissions :</h5>
-       <div class="diff">
-               <div class="diff-left">
-                       <h3>Users</h3>
-                       <ol class="attr">
-                               {{#each userList}}
-                                       <li class="change-row">{{./this}}</li>
-                               {{/each }}      
-                       </ol>
-               </div>
-               <div class="diff-left" data-id="diff" data-name="policyDiff">
-                       <h3>Old Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty previousUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                               {{#compare 
permType "eq" ''}}
-                                                                       
-                                                               {{else}}
-                                                                       
{{{highlightPermissionsForUser ../this ../../property ../../../newUserPermList 
'old'}}}
-                                                                       
<span>,</span> 
-                                                               {{/compare}}
-                                               {{/each}}
-                                       </li>
-                               {{/eachProperty }}
-                       </ol>
-               </div>
-               <div class="diff-right" data-id="diff" data-name="policyDiff">
-                       <h3>New Value</h3>
-                       <ol class="unstyled data">
-                               {{#eachProperty newUserPermList}}
-                                       <li class="change-row">
-                                               {{#each value}}
-                                                               
{{{highlightPermissionsForUser ./this ../property ../../previousUserPermList 
'new'}}}
-                                                               <span>,</span>
-                                               {{/each}}
-                               </li>
-                               {{/eachProperty}}
-                       </ol>
-               </div>
-       </div> 
-{{/if}}        
-</div>

Reply via email to