Explorar o código

HUE-3844 [sentry] Solr config privilege action should be ALL not QUERY

Romain Rigaux %!s(int64=9) %!d(string=hai) anos
pai
achega
b7b9d1d

+ 2 - 0
apps/security/src/security/static/security/js/sentry.ko.js

@@ -832,8 +832,10 @@ var SentryViewModel = function (initial) {
 
   self.availablePrivileges = ko.observableArray();
   self.availableActions = ko.observableArray();
+  self.availableSolrConfigActions = ko.observableArray();
   if (initial.component == 'solr') {
     self.availableActions(['QUERY', 'UPDATE', 'ALL']);
+    self.availableSolrConfigActions(['ALL']);
   } else {
     self.availableActions(['SELECT', 'INSERT', 'ALL']);
   }

+ 2 - 1
apps/security/src/security/templates/sentry.mako

@@ -73,9 +73,10 @@ ${ layout.menubar(section=component) }
 
       <select data-bind="options: $root.availableActions, value: $data.action, enable: (privilegeType() == 'DATABASE')" style="width: 100px; margin-bottom: 0"></select>
     <!-- /ko -->
+
     <!-- ko if: $root.component() == 'solr' -->
       <input type="text" class="input-xxlarge" data-bind="solrchooser: $data.path" placeholder="collection name <CTRL+SPACE>">
-      <select data-bind="options: $root.availableActions, value: $data.action, enable: (privilegeType() == 'COLLECTION')" style="width: 100px; margin-bottom: 0"></select>
+      <select data-bind="options: privilegeType() == 'CONFIG' ? $root.availableSolrConfigActions : $root.availableActions, value: $data.action, enable: (privilegeType() == 'COLLECTION')" style="width: 100px; margin-bottom: 0"></select>
     <!-- /ko -->
 
     <div class="new-line-if-small">