You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by me...@apache.org on 2018/12/19 12:00:34 UTC

[ranger] 11/36: RANGER-2258: Improve the policy list page to prompt users when the service is disabled

This is an automated email from the ASF dual-hosted git repository.

mehul pushed a commit to branch ranger-1.2
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit c9abf9bb2dc6be042fc624b8d19b38a4b2a0be49
Author: zhangqiang2 <zh...@zte.com.cn>
AuthorDate: Fri Oct 19 15:59:11 2018 +0800

    RANGER-2258: Improve the policy list page to prompt users when the service is disabled
    
    Signed-off-by: peng.jianhua <pe...@zte.com.cn>
---
 .../src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js | 4 ++--
 .../main/webapp/templates/policies/RangerPolicyTableLayout_tmpl.html  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

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 1150838..90ad83e 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
@@ -56,7 +56,7 @@ define(function(require){
 				rangerPolicyType : this.collection.queryParams['policyType'],
 				isRenderAccessTab : XAUtil.isRenderMasking(this.rangerServiceDefModel.get('dataMaskDef')) ? true 
                                         : XAUtil.isRenderRowFilter(this.rangerServiceDefModel.get('rowFilterDef')) ? true : false,
-                isNotAuditorAdminOrKmsAuditor : !(XAUtil.isAuditorOrKMSAuditor(SessionMgr))
+                isAddNewPolicyButtonShow : !(XAUtil.isAuditorOrKMSAuditor(SessionMgr)) && this.rangerService.get('isEnabled')
 			};
 		},
         
@@ -168,7 +168,7 @@ define(function(require){
 				gridOpts : {
 					row: Backgrid.Row.extend({}),
 					header : XABackgrid,
-					emptyText : 'No Policies found!'
+					emptyText : 'No Policies found!' + (this.rangerService.get('isEnabled') ? '' : ' The service is disabled!')
 				},
 			}));
 		},
diff --git a/security-admin/src/main/webapp/templates/policies/RangerPolicyTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/policies/RangerPolicyTableLayout_tmpl.html
index bcd495c..a2b930f 100644
--- a/security-admin/src/main/webapp/templates/policies/RangerPolicyTableLayout_tmpl.html
+++ b/security-admin/src/main/webapp/templates/policies/RangerPolicyTableLayout_tmpl.html
@@ -45,7 +45,7 @@
             </div>
             <div class="span2">
                 <div class="clearfix btn-right">
-                    {{#if isNotAuditorAdminOrKmsAuditor}}
+                    {{#if isAddNewPolicyButtonShow}}
                             <a data-js="addNewPolicy" href="#!/service/{{rangerService.id}}/policies/create/{{this.rangerPolicyType}}" class="btn btn-primary " type="button">{{tt 'lbl.addNewPolicy'}} </a>
                     {{/if}}
                 </div>