Browse Source

HUE-572 [fb] Hide change owner/group button for non HDFS superuser

Disabled button to Change owner/group for normal users (non-fs_superusers)
Enrico Berti 13 years ago
parent
commit
1c62d2e6ab

+ 2 - 0
apps/filebrowser/src/filebrowser/templates/fb_components.mako

@@ -28,7 +28,9 @@ from django.utils.translation import ugettext as _
                 <p style="padding: 4px">
                     <button class="btn fileToolbarBtn" title="${_('Rename')}" data-bind="click: renameFile, enable: selectedFiles().length == 1"><i class="icon-font"></i> ${_('Rename')}</button>
                     <button class="btn fileToolbarBtn" title="${_('Move')}" data-bind="click: move, enable: selectedFiles().length == 1"><i class="icon-random"></i> ${_('Move')}</button>
+                    %if is_fs_superuser:
                     <button class="btn fileToolbarBtn" title="${_('Change Owner / Group')}" data-bind="click: changeOwner, enable: selectedFiles().length == 1"><i class="icon-user"></i> ${_('Change Owner / Group')}</button>
+                    %endif
                     <button class="btn fileToolbarBtn" title="${_('Change Permissions')}" data-bind="click: changePermissions, enable: selectedFiles().length == 1"><i class="icon-list-alt"></i> ${_('Change Permissions')}</button>
                     <button class="btn fileToolbarBtn" title="${_('Delete')}" data-bind="click: deleteSelected, enable: selectedFiles().length == 1"><i class="icon-trash"></i> ${_('Delete')}</button>
                     &nbsp;&nbsp;&nbsp;&nbsp;

+ 1 - 0
apps/filebrowser/src/filebrowser/views.py

@@ -443,6 +443,7 @@ def listdir_paged(request, path):
         'cwd_set': True,
         'file_filter': 'any',
         'current_dir_path': path,
+        'is_fs_superuser': request.user.username == request.fs.superuser
     }
     return render('listdir.mako', request, data)