diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-10 16:00:55 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-10 16:00:55 +0100 |
commit | 1301ec93519a39fa88c2eca1e679b20dbb560975 (patch) | |
tree | a4a1ba160dc4e8d813602bcef60bc5f7f5ff3ae9 /core/js | |
parent | 63b99b614c53c903148f4a7ff0c02ca625aa9890 (diff) | |
download | nextcloud-server-1301ec93519a39fa88c2eca1e679b20dbb560975.tar.gz nextcloud-server-1301ec93519a39fa88c2eca1e679b20dbb560975.zip |
Only show link shares for the current user
Currently we have no way to display multiple links in the UI.
So just display the link share for the current user.
Fixes #22275
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/shareitemmodel.js | 9 | ||||
-rw-r--r-- | core/js/tests/specs/shareitemmodelSpec.js | 8 |
2 files changed, 14 insertions, 3 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index a7764dd6266..a28bcac91cb 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -46,6 +46,7 @@ * @property {string} mail_send * @property {Date} expiration optional? * @property {number} stime optional? + * @property {string} uid_owner */ /** @@ -725,6 +726,14 @@ || share.item_source === this.get('itemSource')); if (isShareLink) { + /* + * Ignore reshared link shares for now + * FIXME: Find a way to display properly + */ + if (share.uid_owner !== OC.currentUser) { + return share; + } + var link = window.location.protocol + '//' + window.location.host; if (!share.token) { // pre-token link diff --git a/core/js/tests/specs/shareitemmodelSpec.js b/core/js/tests/specs/shareitemmodelSpec.js index b2480a8beaa..8c9560d2646 100644 --- a/core/js/tests/specs/shareitemmodelSpec.js +++ b/core/js/tests/specs/shareitemmodelSpec.js @@ -164,6 +164,8 @@ describe('OC.Share.ShareItemModel', function() { } ])); + OC.currentUser = 'root'; + model.fetch(); var shares = model.get('shares'); @@ -253,7 +255,7 @@ describe('OC.Share.ShareItemModel', function() { uid_owner: 'root' }] )); - + OC.currentUser = 'root'; model.fetch(); var shares = model.get('shares'); @@ -443,7 +445,7 @@ describe('OC.Share.ShareItemModel', function() { token: 'tehtoken', uid_owner: 'root' }])); - + OC.currentUser = 'root'; model.fetch(); var res = model.sendEmailPrivateLink('foo@bar.com'); @@ -493,7 +495,7 @@ describe('OC.Share.ShareItemModel', function() { token: 'tehtoken', uid_owner: 'root' }])); - + OC.currentUser = 'root'; model.fetch(); var res = model.sendEmailPrivateLink('foo@bar.com'); |