diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-23 14:48:35 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-24 10:05:37 -0400 |
commit | cfec290ad90f8bce01f37cd0ec1f957219770aad (patch) | |
tree | 0d8b57ff1fd0cf9f85cc1fa6e3baef0b1759b64b /apps | |
parent | 3148edbdefa161f6ff72ccc50387136f185edb7e (diff) | |
download | nextcloud-server-cfec290ad90f8bce01f37cd0ec1f957219770aad.tar.gz nextcloud-server-cfec290ad90f8bce01f37cd0ec1f957219770aad.zip |
Prevent resharing in UI if share permission not granted
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/js/share.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index bcfd42ce21e..12c1a3332c9 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -2,7 +2,7 @@ $(document).ready(function() { if (typeof FileActions !== 'undefined') { OC.Share.loadIcons('file'); - FileActions.register('all', 'Share', FileActions.PERMISSION_SHARE, function(filename) { + FileActions.register('all', 'Share', FileActions.PERMISSION_READ, function(filename) { // Return the correct sharing icon if (scanFiles.scanning) { return; } // workaround to prevent additional http request block scanning feedback if ($('#dir').val() == '/') { @@ -36,13 +36,13 @@ $(document).ready(function() { } else { var item = $('#dir').val() + '/' + filename; } - if ($('tr').filterAttr('data-file', filename).data('type') == 'dir') { + var tr = $('tr').filterAttr('data-file', filename); + if ($(tr).data('type') == 'dir') { var itemType = 'folder'; - var possiblePermissions = OC.Share.PERMISSION_CREATE | OC.Share.PERMISSION_UPDATE | OC.Share.PERMISSION_DELETE | OC.Share.PERMISSION_SHARE; } else { var itemType = 'file'; - var possiblePermissions = OC.Share.PERMISSION_UPDATE | OC.Share.PERMISSION_DELETE | OC.Share.PERMISSION_SHARE; } + var possiblePermissions = $(tr).data('permissions'); var appendTo = $('tr').filterAttr('data-file', filename).find('td.filename'); // Check if drop down is already visible for a different file if (OC.Share.droppedDown) { |