You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2019/05/20 12:45:13 UTC
[ranger] 02/02: RANGER-2439: Unable to view policy details from
access audits when policy has policy condition at policy level
This is an automated email from the ASF dual-hosted git repository.
ni3galave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git
commit 0adbd66a7a6f27d120641d481a452a2c036e35c0
Author: Nitin Galave <ni...@apache.org>
AuthorDate: Fri May 17 15:49:04 2019 +0530
RANGER-2439: Unable to view policy details from access audits when policy has policy condition at policy level
---
.../src/main/webapp/scripts/views/policies/RangerPolicyRO.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
index 1af54e1..a4b6087 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
@@ -174,8 +174,8 @@ define(function(require) {
if(this.policy.has('validitySchedules')){
details.validitySchedules = this.policy.get('validitySchedules');
}
- if(this.policy.has('conditions') && this.policy.get('conditions').length > 0){
- details.conditions = XAUtils.getPolicyConditionDetails(this.policy.get('conditions'), self.rangerService);
+ if(this.policy.has('conditions') && this.policy.get('conditions').length > 0 && self.serviceDef){
+ details.conditions = XAUtils.getPolicyConditionDetails(this.policy.get('conditions'), self.serviceDef);
}
//get policyItems
this.createPolicyItems();
@@ -267,6 +267,9 @@ define(function(require) {
getPolicyByVersion : function(ver, e){
//to support old policy log after updating that policy.
this.policy.set('serviceType',undefined);
+ if(this.policy.has('conditions')){
+ this.policy.set('conditions', '');
+ }
this.policy.fetchByVersion(ver, {
cache : false,
async : false