Explorar o código

[sentry] Do not show the add privilege button on Browse view for non admin

We can't hide the whole block as tge next 50 buttons could be there, even
for non admin.
Romain Rigaux %!s(int64=10) %!d(string=hai) anos
pai
achega
c930c53486
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      apps/security/src/security/templates/hive.mako

+ 1 - 1
apps/security/src/security/templates/hive.mako

@@ -35,7 +35,7 @@ ${ layout.menubar(section='hive') }
   <!-- ko ifnot: $root.isApplyingBulk() -->
   <div class="acl-block acl-actions">
     <span class="pointer" data-bind="visible: privilegesForViewTo() < privileges().length, click: function(){ privilegesForViewTo(privilegesForViewTo() + 50) }" title="${ _('Show 50 more...') }"><i class="fa fa-ellipsis-h"></i></span>
-    <span class="pointer" data-bind="click: addPrivilege" title="${ _('Add privilege') }"><i class="fa fa-plus"></i></span>
+    <span class="pointer" data-bind="click: addPrivilege, visible: $root.is_sentry_admin" title="${ _('Add privilege') }"><i class="fa fa-plus"></i></span>
     <span class="pointer" data-bind="click: function() { $root.list_sentry_privileges_by_authorizable() }, visible: privilegesChanged().length > 0" title="${ _('Undo') }"> &nbsp; <i class="fa fa-undo"></i></span>
     <span class="pointer" data-bind="click: function() { deletePrivilegeModal($data) }, visible: privilegesChanged().length > 0" title="${ _('Save') }"> &nbsp; <i class="fa fa-save"></i></span>
   </div>