diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-07-08 10:31:33 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-07-08 10:31:33 +0200 |
commit | 5d3d44eeb9aa2d27ed2541c3c41d231dba22642e (patch) | |
tree | c87e3a1ccb8573477b17be234d6c9d34c1f4b73a | |
parent | 51978aa2962dd2a4ca51e8aaa803be51909cb1ca (diff) | |
parent | c04beb0bad0f783c0783dd4ad222718009061388 (diff) | |
download | nextcloud-server-5d3d44eeb9aa2d27ed2541c3c41d231dba22642e.tar.gz nextcloud-server-5d3d44eeb9aa2d27ed2541c3c41d231dba22642e.zip |
Merge pull request #17370 from owncloud/stable8.1-share-onlyshowstaticownerifavailable
[stable8.1] Do not show static share owner if not available
-rw-r--r-- | apps/files_sharing/js/share.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/js/shareSpec.js | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 11c3170c2f0..0c7d5f3c576 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -151,7 +151,7 @@ var permissions = $tr.data('permissions'); var hasLink = !!(shareStatus && shareStatus.link); OC.Share.markFileAsShared($tr, true, hasLink); - if ((permissions & OC.PERMISSION_SHARE) === 0) { + if ((permissions & OC.PERMISSION_SHARE) === 0 && $tr.attr('data-share-owner')) { // if no share action exists because the admin disabled sharing for this user // we create a share notification action to inform the user about files // shared with him otherwise we just update the existing share action. diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js index 1b1e363b792..1bbf4ffca09 100644 --- a/apps/files_sharing/tests/js/shareSpec.js +++ b/apps/files_sharing/tests/js/shareSpec.js @@ -206,6 +206,23 @@ describe('OCA.Sharing.Util tests', function() { expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg'); expect($action.find('img').length).toEqual(1); }); + it('do not show static share text when share exists but neither permission nor owner is available', function() { + var $action, $tr; + fileList.setFiles([{ + id: 1, + type: 'dir', + name: 'One', + path: '/subdir', + mimetype: 'text/plain', + size: 12, + permissions: OC.PERMISSION_CREATE, + etag: 'abc' + }]); + $tr = fileList.$el.find('tbody tr:first'); + expect($tr.find('.action-share').length).toEqual(0); + $action = $tr.find('.action-share-notification'); + expect($action.length).toEqual(0); + }); }); describe('Share action', function() { var showDropDownStub; |