Skip to content
Snippets Groups Projects
Commit 9da10788 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #17349 from owncloud/share-onlyshowstaticownerifavailable

Do not show static share owner if not available
parents f7079165 71ae96bb
No related branches found
No related tags found
No related merge requests found
......@@ -155,7 +155,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.
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment