You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by pr...@apache.org on 2018/03/15 09:50:32 UTC

ranger git commit: RANGER-2015: In view policy we are able to see 'Deny Policy' & 'Except Conditions' even if 'enableDenyAndExceptionsInPolicies : false'

Repository: ranger
Updated Branches:
  refs/heads/master cc21ffa63 -> 57222febb


RANGER-2015: In view policy we are able to see 'Deny Policy' & 'Except Conditions' even if 'enableDenyAndExceptionsInPolicies : false'

Signed-off-by: pradeep <pr...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/57222feb
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/57222feb
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/57222feb

Branch: refs/heads/master
Commit: 57222febb111066c0867618b89e36c0d44c653c5
Parents: cc21ffa
Author: ni3galave <ni...@gmail.com>
Authored: Thu Mar 15 12:56:16 2018 +0530
Committer: pradeep <pr...@apache.org>
Committed: Thu Mar 15 15:19:51 2018 +0530

----------------------------------------------------------------------
 .../scripts/modules/globalize/message/en.js     |  18 --
 .../views/policies/RangerPolicyConditions.js    |  54 ------
 .../views/policies/RangerPolicyDetail.js        | 168 -------------------
 .../scripts/views/policies/RangerPolicyRO.js    |  83 +++++----
 .../views/policies/RangerPolicyTableLayout.js   |   7 +-
 security-admin/src/main/webapp/styles/xa.css    |   1 +
 .../policies/RangerPolicyConditions_tmpl.html   |  79 ---------
 .../policies/RangerPolicyDetail_tmpl.html       |  88 ----------
 .../templates/policies/RangerPolicyRO_tmpl.html |   8 +
 9 files changed, 67 insertions(+), 439 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
index d10c6a7..8afc2e6 100644
--- a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
+++ b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
@@ -351,24 +351,6 @@ define(function(require) {
                 pluginStatus                :'Plugin Status',
                 clusterName                 :'Name of ambari cluster',
                 url        					:'Hive url.',
-                enabled                     :'enabled',
-                disabled                    :'disabled',
-                Url                         :'Url',
-                recursive                   :'recursive',
-                nonRecursive                :'non-recursive',
-                dataBase                    :'DataBase',
-                exclude                     :'exclude',
-                include                     :'include',
-                yes                         :'Yes',
-                no                          :'No',
-                conditions                  :'Conditions',
-                exAllowCondition            :'Exclude from Allow Conditions',
-                denyCondition               :'Deny Conditions',
-                exDenyCondition             :'Exclude from Deny Conditions',
-                maskingOption               :'Masking Option',
-                masking                     :'Masking',
-                custom                      :'CUSTOM',
-                mask                        :'Mask',
                 rowFilter                   : 'Row Filter',
                 policyLabelsinfo			: 'Label of policy',
                 serviceDetails              :'Service Details',

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyConditions.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyConditions.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyConditions.js
deleted file mode 100644
index 96d9c8b..0000000
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyConditions.js
+++ /dev/null
@@ -1,54 +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.
- */
-
-/*
- * Policy Conditions view
- */
-
-define(function(require) {
-	'use strict';
-
-	var Backbone = require('backbone');
-	var XAUtil = require('utils/XAUtils');
-	var localization = require('utils/XALangSupport');
-
-	var RangerPolicyConditionsTmpl = require('hbs!tmpl/policies/RangerPolicyConditions_tmpl');
-
-	var RangerPolicyConditions = Backbone.Marionette.Layout.extend({
-		_viewName: 'RangerPolicyConditions',
-
-		template: RangerPolicyConditionsTmpl,
-
-		templateHelpers: function() {
-			return {
-				policyItems: this.policyItems,
-				isMaskingPolicy: XAUtil.isMaskingPolicy(this.policyId),
-				isAccessPolicy: XAUtil.isAccessPolicy(this.policyId),
-				isRowFilterPolicy: XAUtil.isRowFilterPolicy(this.policyId)
-			};
-		},
-
-		initialize: function(options) {
-			console.log("initialized a RangerPolicyConditions Layout");
-			_.extend(this, _.pick(options, 'policyItems', 'policyId'));
-		}
-
-	});
-	return RangerPolicyConditions;
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyDetail.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyDetail.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyDetail.js
deleted file mode 100644
index 80ef1f1..0000000
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyDetail.js
+++ /dev/null
@@ -1,168 +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.
- */
-
-/*
- * Policy Detail view
- */
-
-define(function(require) {
-	'use strict';
-
-	var Backbone = require('backbone');
-	var XAUtil = require('utils/XAUtils');
-	var localization = require('utils/XALangSupport');
-	var RangerServiceDef = require('models/RangerServiceDef');
-	var RangerPolicyDetailTmpl = require('hbs!tmpl/policies/RangerPolicyDetail_tmpl');
-	var RangerPolicyConditions = require('views/policies/RangerPolicyConditions');
-
-	var RangerPolicyDetail = Backbone.Marionette.Layout.extend({
-		_viewName: 'RangerPolicyDetail',
-
-		template: RangerPolicyDetailTmpl,
-
-		regions: {
-			'allowCondition': 'div[data-id="allowCondition"]',
-			'exAllowCondition': 'div[data-id="exAllowCondition"]',
-			'denyCondition': 'div[data-id="denyCondition"]',
-			'exDenyCondition': 'div[data-id="exDenyCondition"]'
-		},
-
-		templateHelpers: function() {
-			var policyId = this.model.get("policyType");
-			var policyType = localization.tt('h.access');
-			var conditionType = localization.tt('lbl.allow');
-                        var policyLabels = this.model.get("policyLabels");
-			if(XAUtil.isMaskingPolicy(policyId)) {
-				policyType = localization.tt('h.masking');
-				conditionType = localization.tt('h.mask');
-			} else if(XAUtil.isRowFilterPolicy(policyId)) {
-				policyType = localization.tt('lbl.rowLevelFilter');
-				conditionType = localization.tt('h.rowFilter');
-			}
-			return {
-				policyType: policyType,
-				resources: this.initResource(),
-				conditionType: conditionType,
-				isMaskingPolicy: XAUtil.isMaskingPolicy(policyId),
-				isAccessPolicy: XAUtil.isAccessPolicy(policyId),
-                                isRowFilterPolicy: XAUtil.isRowFilterPolicy(policyId),
-                                policyLabels : policyLabels,
-			};
-		},
-
-		initialize: function(options) {
-			console.log("initialized a RangerPolicyDetail Layout");
-			_.extend(this, _.pick(options, 'rangerService'));
-			this.initializeServiceDef();
-		},
-
-		initializeServiceDef: function() {
-			this.rangerServiceDefModel = new RangerServiceDef();
-			this.rangerServiceDefModel.url = XAUtil.getRangerServiceDef(this.rangerService.get('type'));
-			this.rangerServiceDefModel.fetch({
-				cache: false,
-				async: false
-			});
-		},
-
-		initResource: function() {
-			var resources = [];
-			var resourceObj = this.model.get("resources");
-			var configs = this.rangerServiceDefModel.get("resources")
-			if(XAUtil.isMaskingPolicy(this.model.get('policyType'))) {
-				if(XAUtil.isRenderMasking(this.rangerServiceDefModel.get('dataMaskDef'))) {
-					configs = this.rangerServiceDefModel.get('dataMaskDef').resources;
-				}
-			} else if(XAUtil.isRowFilterPolicy(this.model.get('policyType'))) {
-				if(XAUtil.isRenderRowFilter(this.rangerServiceDefModel.get('rowFilterDef'))) {
-					configs = this.rangerServiceDefModel.get('rowFilterDef').resources;
-				}
-			}
-			_.each(configs, function(obj, index) {
-				var value = resourceObj[obj.name];
-				if(_.isUndefined(value)){
-					return;
-				}
-				var resource = {};
-				resource.label = obj.label;
-				resource.values = value.values;
-				resource.isSupport = false;
-				if(obj.excludesSupported){
-					resource.isSupport = true;
-					if(value.isExcludes){
-						resource.exBool = false;
-						resource.exLabel = localization.tt('h.exclude')
-					}else{
-						resource.exBool = true;
-						resource.exLabel = localization.tt('h.include')
-					}
-				}else if(obj.recursiveSupported){
-					resource.isSupport = true;
-					if(value.isRecursive){
-						resource.exBool = true;
-						resource.exLabel = localization.tt('h.recursive')
-					}else{
-						resource.exBool = fasle;
-						resource.exLabel = localization.tt('h.nonRecursive')
-					}
-				}
-				resources.push(resource);
-			});
-			return resources;
-		},
-
-		onRender: function() {
-			this.initializeConditions();
-		},
-
-		initializeConditions: function() {
-			var policyId = this.model.get("policyType");
-			if(XAUtil.isAccessPolicy(policyId)) {
-				this.allowCondition.show(new RangerPolicyConditions({
-					policyItems: this.model.get("policyItems"),
-					policyId: policyId
-				}));
-				this.exAllowCondition.show(new RangerPolicyConditions({
-					policyItems: this.model.get("allowExceptions"),
-					policyId: policyId
-				}));
-				this.denyCondition.show(new RangerPolicyConditions({
-					policyItems: this.model.get("denyPolicyItems"),
-					policyId: policyId
-				}));
-				this.exDenyCondition.show(new RangerPolicyConditions({
-					policyItems: this.model.get("denyExceptions"),
-					policyId: policyId
-				}));
-			} else if(XAUtil.isMaskingPolicy(policyId)) {
-				this.allowCondition.show(new RangerPolicyConditions({
-					policyItems: this.model.get("dataMaskPolicyItems"),
-					policyId: policyId
-				}));
-			} else if(XAUtil.isRowFilterPolicy(policyId)) {
-				this.allowCondition.show(new RangerPolicyConditions({
-					policyItems: this.model.get("rowFilterPolicyItems"),
-					policyId: policyId
-				}));
-			}
-		}
-
-	});
-	return RangerPolicyDetail;
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
----------------------------------------------------------------------
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 998a0a9..fa7f191 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
@@ -26,6 +26,7 @@ define(function(require) {
 	var XAGlobals = require('utils/XAGlobals');
 	var XAUtils = require('utils/XAUtils');
 	var localization = require('utils/XALangSupport');
+        var XAUtil = require('utils/XAUtils');
 
 	var RangerPolicyROTmpl = require('hbs!tmpl/policies/RangerPolicyRO_tmpl');
 	var RangerService = require('models/RangerService');
@@ -36,6 +37,7 @@ define(function(require) {
 		template: RangerPolicyROTmpl,
 		templateHelpers: function() {
             var isDelegatAdminChk;
+            var policyType = XAUtil.enumElementByValue(XAEnums.RangerPolicyType, this.policy.get('policyType'));
             if(this.policyDetails.serviceType !== XAEnums.ServiceType.SERVICE_TAG.label
                 && !XAUtils.isMaskingPolicy(this.policy.get('policyType'))
                 && !XAUtils.isRowFilterPolicy(this.policy.get('policyType'))) {
@@ -45,7 +47,8 @@ define(function(require) {
             }
 			return {
 				PolicyDetails: this.policyDetails,
-                isDelegatAdmin: isDelegatAdminChk
+                isDelegatAdmin: isDelegatAdminChk,
+                policyType: policyType.label
 			};
 		},
 		breadCrumbs: [],
@@ -80,28 +83,35 @@ define(function(require) {
 			var data = {
 				eventTime : this.eventTime,
 			};
-			this.policy.fetchByEventTime({
-				async: false,
-				cache: false,
-                                data : data,
-                                error : function(error , response){
-                                        if (response && response.status === 419 ) {
-                                                XAUtils.defaultErrorHandler(error , response);
-                                        } else {
-                                                XAUtils.showErrorMsg(response.responseJSON.msgDesc);
-                                        }
-                                }
-			});
+            if(!_.isEmpty(this.eventTime)){
+                this.policy.fetchByEventTime({
+                    async: false,
+                    cache: false,
+                    data : data,
+                    error : function(error , response){
+                            if (response && response.status === 419 ) {
+                                    XAUtils.defaultErrorHandler(error , response);
+                            } else {
+                                    XAUtils.showErrorMsg(response.responseJSON.msgDesc);
+                            }
+                    }
+                });
+            }else{
+                this.policy = this.model;
+                this.serviceDef = this.rangerService;
+            }
 		},
 
 		initializePolicyDetailsObj : function(){
-            // In this.policy service type is undefined then we take repotype.
-            if(_.isUndefined(this.policy.get('serviceType'))){
-                    this.serviceDef = this.serviceDefList.findWhere({'id' : this.repoType})
-            }else{
-                    this.serviceDef = this.serviceDefList.findWhere({'name':this.policy.get('serviceType')});
+            if(!_.isUndefined(this.eventTime)){
+                // In this.policy service type is undefined then we take repotype.
+                if(_.isUndefined(this.policy.get('serviceType'))){
+                        this.serviceDef = this.serviceDefList.findWhere({'id' : this.repoType})
+                }else{
+                        this.serviceDef = this.serviceDefList.findWhere({'name':this.policy.get('serviceType')});
+                }
             }
-			var self = this;
+			var self = this , resourceDef;
 			var details = this.policyDetails = {};
 			details.id = this.policy.get('id');
 			details.name = this.policy.get('name');
@@ -112,7 +122,16 @@ define(function(require) {
 			details.service = this.policy.get('service');
 			details.serviceType = this.serviceDef.get('name');
 			details.isRecursive = undefined;
-			_.each(this.serviceDef.get('resources'), function(def, i){
+            if(XAUtils.isAccessPolicy(this.policy.get('policyType'))){
+                resourceDef = this.serviceDef.get('resources');
+            }else{
+                if(XAUtils.isMaskingPolicy(this.policy.get('policyType'))){
+                    resourceDef = this.serviceDef.get('dataMaskDef').resources;
+                }else{
+                    resourceDef = this.serviceDef.get('rowFilterDef').resources;
+                }
+            }
+            _.each(resourceDef, function(def, i){
 				if(!_.isUndefined(this.policy.get('resources')[def.name])){
 					var resource = {},
 						policyResources = this.policy.get('resources')[def.name];
@@ -154,16 +173,24 @@ define(function(require) {
 		},
 		createPolicyItems : function(){
 			this.policyDetails['policyItemsCond'] = [];
-			var headers = this.getPermHeaders();
+			var headers = this.getPermHeaders(), items = [];
 			this.policyDetails['policyCondition'] = headers.policyCondition;
-			var items = [{'itemName': 'policyItems',title : 'Allow Condition'},
-			             {'itemName': 'allowExceptions',title : 'Exclude from Allow Conditions'},
-			             {'itemName': 'denyPolicyItems',title : 'Deny Condition'},
-                         {'itemName': 'denyExceptions',title : 'Exclude from Deny Conditions'},
-                         {'itemName': 'dataMaskPolicyItems',title : 'Masking Conditions'},
-                         {'itemName': 'rowFilterPolicyItems',title : 'Row Level Conditions'}]
+            if(XAUtils.isAccessPolicy(this.policy.get('policyType'))){
+                items = [{'itemName': 'policyItems',title : 'Allow Condition'}];
+            }
+            if(XAUtils.isRowFilterPolicy(this.policy.get('policyType'))){
+                items.push({'itemName': 'rowFilterPolicyItems',title : 'Row Level Conditions'});
+            }
+            if(XAUtils.isMaskingPolicy(this.policy.get('policyType'))){
+                items.push({'itemName': 'dataMaskPolicyItems',title : 'Masking Conditions'});
+            }
+            if(JSON.parse(this.serviceDef.get('options').enableDenyAndExceptionsInPolicies) && XAUtils.isAccessPolicy(this.policy.get('policyType'))){
+                items.push({'itemName': 'allowExceptions',title : 'Exclude from Allow Conditions'},
+                          {'itemName': 'denyPolicyItems',title : 'Deny Condition'},
+                          {'itemName': 'denyExceptions',title : 'Exclude from Deny Conditions'});
+            }
 			_.each(items, function(item){
-				if(!_.isUndefined(this.policy.get(item.itemName)) && !_.isEmpty(this.policy.get(item.itemName))){
+                if(!_.isUndefined(this.policy.get(item.itemName))){
 					this.policyDetails['policyItemsCond'].push({ title : item.title, headers : headers.header, policyItems : this.policy.get(item.itemName)})
 				}
 			}, this)

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
index b4006ce..f23d18c 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
@@ -36,7 +36,7 @@ define(function(require){
 	var RangerServiceDef	= require('models/RangerServiceDef');
 	var RangerPolicy 		= require('models/RangerPolicy');
 	var RangerPolicyTableLayoutTmpl = require('hbs!tmpl/policies/RangerPolicyTableLayout_tmpl');
-	var RangerPolicyDetail			= require('views/policies/RangerPolicyDetail');
+        var RangerPolicyRO				= require('views/policies/RangerPolicyRO');
 
 	require('backgrid-filter');
 	require('backgrid-paginator');
@@ -183,9 +183,9 @@ define(function(require){
 			rangerPolicy.fetch({
 				cache : false,
 			}).done(function(){
-				var view = new RangerPolicyDetail({
+                                var view = new RangerPolicyRO({
 					model : rangerPolicy,
-					rangerService: that.rangerService
+                                        rangerService: that.rangerServiceDefModel
 				});
 				var modal = new Backbone.BootstrapModal({
 					animate : true,
@@ -195,7 +195,6 @@ define(function(require){
 					allowCancel : true,
 					escape 	: true
 				}).open();
-				modal.$el.addClass('modal-diff').attr('tabindex',-1);
 				modal.$el.find('.cancel').hide();
 			});
 		},

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/styles/xa.css
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/styles/xa.css b/security-admin/src/main/webapp/styles/xa.css
index 4ba75fb..9eb99d9 100644
--- a/security-admin/src/main/webapp/styles/xa.css
+++ b/security-admin/src/main/webapp/styles/xa.css
@@ -667,6 +667,7 @@ table.backgrid thead tr:hover {
 }
 .updateInfo{
   margin-top: 10px;
+  border-top: 1px solid #ccc;
 }
 .updateInfo p {
   margin-bottom: 0px;

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/templates/policies/RangerPolicyConditions_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/policies/RangerPolicyConditions_tmpl.html b/security-admin/src/main/webapp/templates/policies/RangerPolicyConditions_tmpl.html
deleted file mode 100644
index 6a46bbd..0000000
--- a/security-admin/src/main/webapp/templates/policies/RangerPolicyConditions_tmpl.html
+++ /dev/null
@@ -1,79 +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>
-	<table class="table table-bordered backgrid">
-		<thead>
-			<tr>
-				<th width="20%">{{tt 'lbl.groups'}}</th>
-				<th width="35%">{{tt 'lbl.users'}}</th>
-				{{#if isAccessPolicy}}
-				<th width="35%">{{tt 'lbl.permissions'}}</th>
-				<th width="10%">{{tt 'lbl.delegatedAdmin'}}</th>
-				{{/if}}
-				{{#if isMaskingPolicy}}
-				<th width="25%">{{tt 'lbl.accessTypes'}}</th>
-				<th width="20%">{{tt 'h.maskingOption'}}</th>
-				{{/if}}
-				{{#if isRowFilterPolicy}}
-				<th width="25%">{{tt 'lbl.accessTypes'}}</th>
-				<th width="20%">{{tt 'lbl.rowLevelFilter'}}</th>
-				{{/if}}
-			</tr>
-		</thead>
-		<tbody>
-			{{#each policyItems}}
-			<tr>
-				<td>
-					{{#each ./this.groups}}
-					<span class="label label-info float-left-margin-2">{{./this}}</span> {{/each}}
-				</td>
-				<td>
-					{{#each ./this.users}}
-					<span class="label label-info float-left-margin-2">{{./this}}</span> {{/each}}
-				</td>
-				<td>
-					{{#each ./this.accesses}}
-					<span class="label label-info float-left-margin-2">{{./this.type}}</span> {{/each}}
-				</td>
-				{{#if ../isAccessPolicy}}
-				<td style="text-align: center;vertical-align: middle;">
-					<div>
-						{{#if ./this.delegateAdmin}}
-						<label class="label label-ranger">{{tt 'h.yes'}}</label> {{else}}
-						<label class="label label-important">{{tt 'h.no'}}</label> {{/if}}
-					</div>
-				</td>
-				{{/if}}
-				{{#if ../isMaskingPolicy}}
-				<td>
-					{{#compare dataMaskInfo.dataMaskType 'eq' 'CUSTOM'}}
-					<span class="label label-info float-left-margin-2">{{tt 'h.custom'}}: {{dataMaskInfo.valueExpr}}</span>
-					{{else}}
-					<span class="label label-info float-left-margin-2">{{dataMaskInfo.dataMaskType}}</span>
-					{{/compare}}
-				</td>
-				{{/if}}
-				{{#if ../isRowFilterPolicy}}
-				<td>
-					<span class="label label-info float-left-margin-2">{{rowFilterInfo.filterExpr}}</span>
-				</td>
-				{{/if}}
-			</tr>
-			{{/each}}
-		</tbody>
-	</table>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/templates/policies/RangerPolicyDetail_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/policies/RangerPolicyDetail_tmpl.html b/security-admin/src/main/webapp/templates/policies/RangerPolicyDetail_tmpl.html
deleted file mode 100644
index fae698d..0000000
--- a/security-admin/src/main/webapp/templates/policies/RangerPolicyDetail_tmpl.html
+++ /dev/null
@@ -1,88 +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 id="policyDetail">
-	<label class="no-margin label-size13-weightbold">{{tt 'lbl.policyType'}} : &nbsp;<label class="label label-ranger"> {{policyType}} </label></label>
-	<label class="no-margin label-size13-weightbold">{{tt 'lbl.policyId'}} : &nbsp;<label class="label label-ranger"> {{id}} </label></label>
-	<label class="no-margin label-size13-weightbold">{{tt 'lbl.policyName'}} : {{name}}
-	{{#if isEnabled}}
-	<label class="label label-ranger label-margin">{{tt 'h.enabled'}}</label>
-	{{else}}
-	<label class="label label-important label-margin">{{tt 'h.disabled'}}</label>
-	{{/if}}
-	</label>
-	{{#each resources}}
-	<label class="no-margin label-size13-weightbold">{{./this.label}} : {{./this.values}}
-	{{#if ./this.isSupport}}
-		{{#if ./this.exBool}}
-		<label class="label label-ranger label-margin">{{./this.exLabel}}</label>
-		{{else}}
-		<label class="label label-important label-margin">{{./this.exLabel}}</label>
-		{{/if}}
-	{{/if}}
-	</label>
-	{{/each}}
-	<label class="no-margin label-size13-weightbold">{{tt 'lbl.auditLogging'}} : &nbsp;
-	{{#if isAuditEnabled}}
-		<label class="label label-ranger">{{tt 'h.yes'}}</label>
-	{{else}}
-		<label class="label label-important">{{tt 'h.no'}}</label>
-	{{/if}}
-	</label>
-	<label class="no-margin label-size13-weightbold" style="vertical-align:top;float:left;">{{tt 'lbl.description'}} : &nbsp;&nbsp;</label><textarea style="width: 400px;height: 80px;" readonly="readonly">{{description}}</textarea>
-        <label class="no-margin label-size13-weightbold">{{tt 'lbl.policyLabels'}} : &nbsp;
-        {{#ifCond policyLabels.length '==' "0"}}
-                        --
-                {{else}}
-                        {{#each policyLabels}}
-                                <label class="label label-ranger"> {{this}} </label>
-                {{/each}}
-        {{/ifCond}}
-        </label>
-</div>
-<div>
-	<div>
-		<p class="wrap-header formHeader">
-			{{conditionType}} {{tt 'h.conditions'}} :
-		</p>
-		<div data-id="allowCondition" style="margin-top: 15px;">
-		</div>
-	</div>
-	{{#if isAccessPolicy}}
-	<div>
-		<p class="wrap-header reportSearchHeader">
-			{{tt 'h.exAllowCondition'}} :
-		</p>
-		<div data-id="exAllowCondition">
-		</div>
-	</div>
-	<div>
-		<p class="wrap-header formHeader">
-			{{tt 'h.denyCondition'}} :
-		</p>
-		<div data-id="denyCondition" style="margin-top: 15px;">
-		</div>
-	</div>
-	<div>
-		<p class="wrap-header reportSearchHeader">
-			{{tt 'h.exDenyCondition'}} :
-		</p>
-		<div data-id="exDenyCondition">
-		</div>
-	</div>
-	{{/if}}
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/57222feb/security-admin/src/main/webapp/templates/policies/RangerPolicyRO_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/policies/RangerPolicyRO_tmpl.html b/security-admin/src/main/webapp/templates/policies/RangerPolicyRO_tmpl.html
index 801681b..6d2eb3f 100644
--- a/security-admin/src/main/webapp/templates/policies/RangerPolicyRO_tmpl.html
+++ b/security-admin/src/main/webapp/templates/policies/RangerPolicyRO_tmpl.html
@@ -34,6 +34,14 @@
     <tbody>
       <tr>
         <td>
+          {{tt 'lbl.policyType'}}
+        </td>
+        <td>
+          <div class="controls"><label class="label label-ranger" style="cursor: auto;">{{policyType}}</label></div>
+        </td>
+      </tr>
+      <tr>
+        <td>
           {{tt 'lbl.policyId'}}
         </td>
         <td>