Return-Path: X-Original-To: apmail-argus-commits-archive@minotaur.apache.org Delivered-To: apmail-argus-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC85011584 for ; Mon, 25 Aug 2014 22:31:46 +0000 (UTC) Received: (qmail 74906 invoked by uid 500); 25 Aug 2014 22:31:46 -0000 Delivered-To: apmail-argus-commits-archive@argus.apache.org Received: (qmail 74887 invoked by uid 500); 25 Aug 2014 22:31:46 -0000 Mailing-List: contact commits-help@argus.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@argus.incubator.apache.org Delivered-To: mailing list commits@argus.incubator.apache.org Received: (qmail 74878 invoked by uid 99); 25 Aug 2014 22:31:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2014 22:31:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 25 Aug 2014 22:31:44 +0000 Received: (qmail 74740 invoked by uid 99); 25 Aug 2014 22:31:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2014 22:31:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BF21CA034C5; Mon, 25 Aug 2014 22:31:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sneethir@apache.org To: commits@argus.incubator.apache.org Message-Id: <0f3360d71d6c4e15819453f987375038@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: ARGUS-20: patch to show IP information in diff view for knox policies Date: Mon, 25 Aug 2014 22:31:23 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-argus Updated Branches: refs/heads/master dfdd5176c -> c90142915 ARGUS-20: patch to show IP information in diff view for knox policies Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/c9014291 Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/c9014291 Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/c9014291 Branch: refs/heads/master Commit: c90142915232826a759fab34b111b62b5a484108 Parents: dfdd517 Author: sneethiraj Authored: Mon Aug 25 14:02:25 2014 -0700 Committer: sneethiraj Committed: Mon Aug 25 14:02:25 2014 -0700 ---------------------------------------------------------------------- .../java/com/xasecure/common/XACommonEnums.java | 23 ++- .../java/com/xasecure/entity/XXResource.java | 3 + .../com/xasecure/service/XPermMapService.java | 11 +- .../main/java/com/xasecure/util/XAEnumUtil.java | 15 +- .../views/reports/OperationDiffDetail.js | 38 ++-- .../main/webapp/templates/helpers/XAHelpers.js | 42 +++-- .../KnoxPolicyDeleteOperationDiff_tmpl.html | 100 ++++++++++ .../reports/KnoxPolicyOperationDiff_tmpl.html | 101 ++++++++++ .../KnoxPolicyUpdateOperationDiff_tmpl.html | 189 +++++++++++++++++++ 9 files changed, 483 insertions(+), 39 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java b/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java index 53f107b..9d05c8b 100644 --- a/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java +++ b/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java @@ -498,11 +498,23 @@ public class XACommonEnums { * ASSET_HIVE is an element of enum AssetType. Its value is "ASSET_HIVE". */ public static final int ASSET_HIVE = 3; + /** + * ASSET_HIVE is an element of enum AssetType. Its value is "ASSET_HIVE". + */ + public static final int ASSET_AGENT = 4; + /** + * ASSET_HIVE is an element of enum AssetType. Its value is "ASSET_HIVE". + */ + public static final int ASSET_KNOX = 5; + /** + * ASSET_HIVE is an element of enum AssetType. Its value is "ASSET_HIVE". + */ + public static final int ASSET_STORM = 6; /** * Max value for enum AssetType_MAX */ - public static final int AssetType_MAX = 3; + public static final int AssetType_MAX = 6; /*************************************************************** @@ -1163,6 +1175,15 @@ public class XACommonEnums { if( elementValue == 3 ) { return "Hive"; //ASSET_HIVE } + if( elementValue == 4 ) { + return "Agent"; //ASSET_HIVE + } + if( elementValue == 5 ) { + return "Knox"; //ASSET_HIVE + } + if( elementValue == 6 ) { + return "Storm"; //ASSET_HIVE + } return null; } http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/security-admin/src/main/java/com/xasecure/entity/XXResource.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXResource.java b/security-admin/src/main/java/com/xasecure/entity/XXResource.java index 434aa0c..0868c88 100644 --- a/security-admin/src/main/java/com/xasecure/entity/XXResource.java +++ b/security-admin/src/main/java/com/xasecure/entity/XXResource.java @@ -685,6 +685,9 @@ public class XXResource extends XXDBBase implements java.io.Serializable { if( fieldName.equals("columnType") ) { return "CommonEnums.PolicyType"; } + if( fieldName.equals("assetType") ) { + return "CommonEnums.AssetType"; + } //Later TODO //return super.getEnumName(fieldName); return null; http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/security-admin/src/main/java/com/xasecure/service/XPermMapService.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/service/XPermMapService.java b/security-admin/src/main/java/com/xasecure/service/XPermMapService.java index 76973db..36bd9a3 100644 --- a/security-admin/src/main/java/com/xasecure/service/XPermMapService.java +++ b/security-admin/src/main/java/com/xasecure/service/XPermMapService.java @@ -168,7 +168,7 @@ public class XPermMapService extends XPermMapServiceBase { XXTrxLog xTrxLog = new XXTrxLog(); xTrxLog.setAttributeName(vTrxLogAttr.getAttribUserFriendlyName()); - String value = null; + String value = null,prevValue = ""; boolean isEnum = vTrxLogAttr.isEnum(); if(isEnum){ String enumName = XXPermMap.getEnumName(fieldName); @@ -178,7 +178,11 @@ public class XPermMapService extends XPermMapServiceBase { value = ""+field.get(vObj); // XXUser xUser = xADaoManager.getXXUser().getById(Long.parseLong(value)); // value = xUser.getName(); - if(value == null || value.equalsIgnoreCase("null") || stringUtil.isEmpty(value)){ + if(fieldName.equals("ipAddress") && action.equalsIgnoreCase("update")){ + prevValue = ""+field.get(mObj); + value = value.equalsIgnoreCase("null") ? "" : value; + } + else if(value == null || value.equalsIgnoreCase("null") || stringUtil.isEmpty(value)){ continue; } } @@ -191,6 +195,9 @@ public class XPermMapService extends XPermMapServiceBase { // Not Changed. xTrxLog.setNewValue(value); xTrxLog.setPreviousValue(value); + if(fieldName.equals("ipAddress")){ + xTrxLog.setPreviousValue(prevValue); + } } xTrxLog.setAction(action); http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/security-admin/src/main/java/com/xasecure/util/XAEnumUtil.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/util/XAEnumUtil.java b/security-admin/src/main/java/com/xasecure/util/XAEnumUtil.java index 315a0e3..16d587a 100644 --- a/security-admin/src/main/java/com/xasecure/util/XAEnumUtil.java +++ b/security-admin/src/main/java/com/xasecure/util/XAEnumUtil.java @@ -961,23 +961,24 @@ public class XAEnumUtil { vEnum.getElementList().add(vElement); vElement = new VEnumElement(); - vElement.setElementName("ASSET_KNOX"); + vElement.setElementName("ASSET_AGENT"); vElement.setElementValue(4); - vElement.setElementLabel("Knox"); - vElement.setRbKey("xa.enum.AssetType.ASSET_KNOX"); + vElement.setElementLabel("Agent"); + vElement.setRbKey("xa.enum.AssetType.ASSET_AGENT"); vElement.setEnumName(vEnum.getEnumName()); - + vEnum.getElementList().add(vElement); vElement = new VEnumElement(); - vElement.setElementName("ASSET_AGENT"); + vElement.setElementName("ASSET_KNOX"); vElement.setElementValue(5); - vElement.setElementLabel("Agent"); - vElement.setRbKey("xa.enum.AssetType.ASSET_AGENT"); + vElement.setElementLabel("Knox"); + vElement.setRbKey("xa.enum.AssetType.ASSET_KNOX"); vElement.setEnumName(vEnum.getEnumName()); vEnum.getElementList().add(vElement); + vElement = new VEnumElement(); vElement.setElementName("ASSET_STORM"); vElement.setElementValue(6); http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/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 f708859..dc5a591 100644 --- a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js +++ b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js @@ -18,6 +18,9 @@ define(function(require){ 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'); @@ -97,8 +100,8 @@ define(function(require){ _.extend(this, _.pick(options, 'classType','objectName','objectId','objectCreatedDate','action','userName')); this.bindEvents(); //this.initializeDiffOperation(); - this.getTemplateForView(); + }, /** all events binding here */ @@ -120,7 +123,6 @@ define(function(require){ if(_.isEmpty($(m).text().trim())) $(m).removeClass('change-row').text('--'); }); - }, getTemplateForView : function(){ if(this.classType == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value){ @@ -145,10 +147,12 @@ define(function(require){ } this.resourceDiffOperation(); } - if(this.classType == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value){ + 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){ if(this.action == 'create' || this.action == 'delete'){ this.template = UserOperationDiff_tmpl; - }else if(this.action == 'update'){ + }else if(this.action == 'update' || this.action == "password change"){ this.template = UserUpdateOperationDiff_tmpl; }else{ this.template = UserOperationDiff_tmpl; @@ -195,19 +199,25 @@ define(function(require){ 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('attributeName') == 'Permission Type'){ + if(attrName == "IP Address") + type = 'ipAddress'; + if(m.get('attributeName') == 'Permission Type' || m.get('attributeName') == "IP Address"){ +// if(m.get('attributeName') == 'Permission Type'){ if(m.get('parentObjectClassType') == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value){ if(m.get('action') != 'delete'){ if(m.get('action') == 'create'){ - that.previousGroupPermList.push({groupName : m.get('parentObjectName'), permType : ""}); + var obj = {groupName : m.get('parentObjectName')}; + obj[type] = ""; + that.previousGroupPermList.push(obj); } - that.newGroupPermList.push({groupName : m.get('parentObjectName'), permType : m.get('newValue')}); + obj = {groupName : m.get('parentObjectName')}; + obj[type] = m.get('newValue'); + that.newGroupPermList.push(obj); } if(m.get('action') == 'delete' || m.get('action') == 'update'){ - that.previousGroupPermList.push({groupName : m.get('parentObjectName'), permType : m.get('previousValue')}); + 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')); @@ -241,6 +251,12 @@ define(function(require){ 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; } if(_.isUndefined(m.get('attributeName'))) http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/security-admin/src/main/webapp/templates/helpers/XAHelpers.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/templates/helpers/XAHelpers.js b/security-admin/src/main/webapp/templates/helpers/XAHelpers.js index 7d0cbad..8c0e77a 100644 --- a/security-admin/src/main/webapp/templates/helpers/XAHelpers.js +++ b/security-admin/src/main/webapp/templates/helpers/XAHelpers.js @@ -390,67 +390,73 @@ define(function ( require ){ return html; }); Handlebars.registerHelper('highlightPermissionsForUser', function(perm, newValue, pemList, hightlightValue) { - var html=perm.permType; + var type = 'permType'; + if(_.isUndefined(perm.permType)) + type = 'ipAddress'; + var html = perm[type]; if(hightlightValue == 'old'){ - if(_.isNull(perm.permType) || perm.permType != ""){ + if(_.isNull(perm[type]) || perm[type] != ""){ if(!_.isUndefined(pemList[perm.userName]) || _.isEmpty(pemList)){ var isRemoved = true; _.each(pemList[perm.userName] ,function(m){ - if(m.permType == perm.permType) + if(m[type] == perm[type]) isRemoved = false; }); if(isRemoved) - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; }else{ - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; } } }else{ - if(_.isNull(perm.permType) || perm.permType != ""){ + if(_.isNull(perm[type]) || perm[type] != ""){ if(!_.isUndefined(pemList[perm.userName])){ var isNewAdd = true; _.each(pemList[perm.userName] ,function(m){ - if(m.permType == perm.permType) + if(m[type] == perm[type]) isNewAdd = false; }); if(isNewAdd) - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; }else{ - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; } } } return html; }); Handlebars.registerHelper('highlightPermissionsForGroup', function(perm, newValue, pemList, hightlightValue) { - var html = perm.permType;; + var type = 'permType'; + if(_.isUndefined(perm.permType)) + type = 'ipAddress'; + var html = perm[type]; if(hightlightValue == 'old'){ - if(_.isNull(perm.permType) || perm.permType != ""){ + if(_.isNull(perm[type]) || perm[type] != ""){ if(!_.isUndefined(pemList[perm.groupName]) || _.isEmpty(pemList)){ var isRemoved = true; _.each(pemList[perm.groupName] ,function(m){ - if(m.permType == perm.permType) + if(m[type] == perm[type]) isRemoved = false; }); if(isRemoved) - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; }else{ - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; } } }else{ - if(_.isNull(perm.permType) || perm.permType != ""){ + if(_.isNull(perm[type]) || perm[type] != ""){ if(!_.isUndefined(pemList[perm.groupName])){ var isNewAdd = true; _.each(pemList[perm.groupName] ,function(m){ - if(m.permType == perm.permType) + if(m[type] == perm[type]) isNewAdd = false; }); if(isNewAdd) - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; } else{ - return html = ''+perm.permType+''; + return html = ''+perm[type]+''; } } } http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/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 new file mode 100644 index 0000000..7de39d2 --- /dev/null +++ b/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html @@ -0,0 +1,100 @@ + + + + + +{{#if collection.length}} +
Policy Details :
+
+
+

Fields

+
    + {{#each collection}} +
  1. {{./this.attributes.attributeName}}
  2. + {{/each}} +
+
+
+

Old Value

+
    + {{#each collection}} + {{#if ./this.attributes.previousValue}} + {{#compare ./this.attributes.previousValue "eq" ''}} +
  1. --
  2. + {{else}} +
  3. {{./this.attributes.previousValue}}
  4. + {{/compare}} + {{else}} +
  5. --
  6. + {{/if}} + {{/each}} +
+
+{{/if}} +{{#if isGroupPerm}} +
Group Permissions :
+
+
+

Groups

+
    + {{#eachProperty previousGroupPermList}} +
  1. {{property}}
  2. + {{/eachProperty }} +
+
+
+

Old Value

+
    + {{#eachProperty previousGroupPermList}} +
  1. + {{#each value}} + {{#if permType}} + {{permType}} + , + {{/if}} + {{/each}} + {{#each value}} + {{#if ipAddress}} + IP : {{ipAddress}} + {{/if}} + {{/each}} +
  2. + {{/eachProperty }} +
+
+
+{{/if}} +{{#if isUserPerm}} +
User Permissions :
+
+
+

Users

+
    + {{#eachProperty previousUserPermList}} +
  1. {{property}}
  2. + {{/eachProperty }} +
+
+ +
+

Old Value

+
    + {{#eachProperty previousUserPermList}} +
  1. + {{#each value}} + {{#if permType}} + {{permType}} + , + {{/if}} + {{/each}} + {{#each value}} + {{#if ipAddress}} + IP : {{ipAddress}} + {{/if}} + {{/each}} +
  2. + {{/eachProperty }} +
+
+
+{{/if}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/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 new file mode 100644 index 0000000..29255a7 --- /dev/null +++ b/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html @@ -0,0 +1,101 @@ +
+ + + + + +{{#if collection.length}} +
Policy Details :
+
+
+

Fields

+
    + {{#each collection}} +
  1. {{./this.attributes.attributeName}}
  2. + {{/each}} +
+
+
+

New Value

+
    + {{#each collection}} + {{#if ./this.attributes.newValue}} + {{#compare ./this.attributes.newValue "eq" ''}} +
  1. --
  2. + {{else}} +
  3. {{./this.attributes.newValue}}
  4. + {{/compare}} + {{else}} +
  5. --
  6. + {{/if}} + {{/each}} +
+
+
+{{/if}} +{{#if isGroupPerm}} +
Group Permissions :
+
+
+

Groups

+
    + {{#eachProperty newGroupPermList}} +
  1. {{property}}
  2. + {{/eachProperty }} +
+
+
+

New Value

+
    + {{#eachProperty newGroupPermList}} +
  1. + {{#each value}} + {{#if permType}} + {{permType}}, + {{/if}} + {{/each}} + {{#each value}} + {{#if ipAddress}} + IP : {{ipAddress}} + {{/if}} + {{/each}} +
  2. + {{/eachProperty }} +
+
+
+{{/if}} +{{#if isUserPerm}} +
User Permissions :
+
+
+

Users

+
    + {{#eachProperty newUserPermList}} +
  1. {{property}}
  2. + {{/eachProperty }} +
+
+
+

New Value

+
    + {{#eachProperty newUserPermList}} +
  1. + {{#each value}} + {{#if permType}} + {{permType}}, + {{/if}} + {{/each}} + {{#each value}} + {{#if ipAddress}} + IP : {{ipAddress}} + {{/if}} + {{/each}} +
  2. + {{/eachProperty }} +
+
+
+{{/if}} + +
http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c9014291/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 new file mode 100644 index 0000000..99297a3 --- /dev/null +++ b/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html @@ -0,0 +1,189 @@ +
+
+
+ + + + +
+
+
Added +
Deleted +
+
+{{#if collection.length}} +
Policy Details :
+
+
+

Fields

+
    + {{#each collection}} +
  1. {{./this.attributes.attributeName}}
  2. + {{/each}} +
+
+
+

Old Value

+
    + {{#each collection}} + {{#if ./this.attributes.previousValue}} + {{#compare ./this.attributes.previousValue "eq" ''}} +
  1. --
  2. + {{else}} +
  3. {{{highlightNewForAttr ./this.attributes.newValue ./this.attributes.previousValue 'old'}}}
  4. + {{/compare}} + {{else}} +
  5. --
  6. + {{/if}} + {{/each}} +
+
+
+

New Value

+
    + {{#each collection}} + {{#if ./this.attributes.newValue}} + {{#compare ./this.attributes.newValue "eq" ''}} +
  1. --
  2. + {{else}} +
  3. {{{highlightNewForAttr ./this.attributes.newValue ./this.attributes.previousValue 'new'}}}
  4. + {{/compare}} + {{else}} +
  5. --
  6. + {{/if}} + {{/each}} +
+
+
+{{/if}} +{{#if isGroupPerm}} +
Group Permissions :
+
+
+

Groups

+
    + {{#each groupList}} +
  1. {{./this}}
  2. + {{/each}} +
+
+
+

Old Value

+
    + {{#eachProperty previousGroupPermList}} +
  1. + {{#each value}} + {{#if permType}} + {{#compare permType "eq" ''}} + + {{else}} + {{{highlightPermissionsForGroup ../this ../../../property ../../../../newGroupPermList 'old'}}} + , + {{/compare}} + {{/if}} + {{/each}} + {{#each value}} + {{#if ipAddress}} + {{#compare ipAddress "eq" ''}} + + {{else}} + IP : {{{highlightPermissionsForGroup ../this ../../../property ../../../../newGroupPermList 'old'}}} + , + {{/compare}} + {{/if}} + {{/each}} +
  2. + {{/eachProperty }} +
+
+
+

New Value

+
    + {{#eachProperty newGroupPermList}} +
  1. + {{#each value}} + + {{#if permType}} + {{{highlightPermissionsForGroup ./this ../property ../../../previousGroupPermList 'new'}}} + , + {{/if}} + {{/each}} + {{#each value}} + + {{#if ipAddress}} + IP : {{{highlightPermissionsForGroup ./this ../property ../../../previousGroupPermList 'new'}}} + , + {{/if}} + {{/each}} +
  2. + {{/eachProperty }} +
+
+
+{{/if}} +{{#if isUserPerm}} +
User Permissions :
+
+
+

Users

+
    + {{#each userList}} +
  1. {{./this}}
  2. + {{/each }} +
+
+
+

Old Value

+
    + {{#eachProperty previousUserPermList}} +
  1. + {{#each value}} + {{#if permType}} + {{#compare permType "eq" ''}} + + {{else}} + {{{highlightPermissionsForUser ../this ../../property ../../../../newUserPermList 'old'}}} + , + {{/compare}} + {{/if}} + {{/each}} + {{#each value}} + {{#if ipAddress}} + {{#compare permType "eq" ''}} + + {{else}} + IP : {{{highlightPermissionsForUser ../this ../../property ../../../../newUserPermList 'old'}}} + , + {{/compare}} + {{/if}} + {{/each}} +
  2. + {{/eachProperty }} +
+
+
+

New Value

+
    + {{#eachProperty newUserPermList}} +
  1. + {{#each value}} + {{#if permType}} + + {{{highlightPermissionsForUser ./this ../property ../../../previousUserPermList 'new'}}} + , + {{/if}} + {{/each}} + {{#each value}} + {{#if ipAddress}} + + IP : {{{highlightPermissionsForUser ./this ../property ../../../previousUserPermList 'new'}}} + , + {{/if}} + {{/each}} +
  2. + {{/eachProperty}} +
+
+
+{{/if}} +
\ No newline at end of file