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
This commit is contained in:
Roeland Jago Douma 2016-02-10 16:00:55 +01:00
parent 63b99b614c
commit 1301ec9351
2 changed files with 14 additions and 3 deletions

View File

@ -46,6 +46,7 @@
* @property {string} mail_send * @property {string} mail_send
* @property {Date} expiration optional? * @property {Date} expiration optional?
* @property {number} stime optional? * @property {number} stime optional?
* @property {string} uid_owner
*/ */
/** /**
@ -725,6 +726,14 @@
|| share.item_source === this.get('itemSource')); || share.item_source === this.get('itemSource'));
if (isShareLink) { 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; var link = window.location.protocol + '//' + window.location.host;
if (!share.token) { if (!share.token) {
// pre-token link // pre-token link

View File

@ -164,6 +164,8 @@ describe('OC.Share.ShareItemModel', function() {
} }
])); ]));
OC.currentUser = 'root';
model.fetch(); model.fetch();
var shares = model.get('shares'); var shares = model.get('shares');
@ -253,7 +255,7 @@ describe('OC.Share.ShareItemModel', function() {
uid_owner: 'root' uid_owner: 'root'
}] }]
)); ));
OC.currentUser = 'root';
model.fetch(); model.fetch();
var shares = model.get('shares'); var shares = model.get('shares');
@ -443,7 +445,7 @@ describe('OC.Share.ShareItemModel', function() {
token: 'tehtoken', token: 'tehtoken',
uid_owner: 'root' uid_owner: 'root'
}])); }]));
OC.currentUser = 'root';
model.fetch(); model.fetch();
var res = model.sendEmailPrivateLink('foo@bar.com'); var res = model.sendEmailPrivateLink('foo@bar.com');
@ -493,7 +495,7 @@ describe('OC.Share.ShareItemModel', function() {
token: 'tehtoken', token: 'tehtoken',
uid_owner: 'root' uid_owner: 'root'
}])); }]));
OC.currentUser = 'root';
model.fetch(); model.fetch();
var res = model.sendEmailPrivateLink('foo@bar.com'); var res = model.sendEmailPrivateLink('foo@bar.com');