Merge pull request #1247 from nextcloud/backport/reshare

Adds parameter to retrieve shares with its reshares.
This commit is contained in:
Camila Ayres 2019-05-27 20:16:34 +02:00 committed by GitHub
commit 1dca017537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions

View file

@ -21,7 +21,7 @@ namespace OCC {
OcsShareeJob::OcsShareeJob(AccountPtr account)
: OcsJob(account)
{
setPath("ocs/v1.php/apps/files_sharing/api/v1/sharees");
setPath("ocs/v2.php/apps/files_sharing/api/v1/sharees");
connect(this, &OcsJob::jobFinished, this, &OcsShareeJob::jobDone);
}

View file

@ -24,7 +24,7 @@ namespace OCC {
OcsShareJob::OcsShareJob(AccountPtr account)
: OcsJob(account)
{
setPath("ocs/v1.php/apps/files_sharing/api/v1/shares");
setPath("ocs/v2.php/apps/files_sharing/api/v1/shares");
connect(this, &OcsJob::jobFinished, this, &OcsShareJob::jobDone);
}
@ -33,6 +33,7 @@ void OcsShareJob::getShares(const QString &path)
setVerb("GET");
addParam(QString::fromLatin1("path"), path);
addParam(QString::fromLatin1("reshares"), QString("true"));
addPassStatusCode(404);
start();

View file

@ -271,6 +271,7 @@ void ShareDialog::showSharingUi()
auto label = new QLabel(this);
label->setText(tr("The file can not be shared because it was shared without sharing permission."));
label->setWordWrap(true);
_ui->verticalLayout->insertWidget(1, label);
return;
}

View file

@ -202,6 +202,7 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>>
connect(s, &ShareUserLine::visualDeletionDone, this, &ShareUserGroupWidget::getShares);
s->setBackgroundRole(layout->count() % 2 == 0 ? QPalette::Base : QPalette::AlternateBase);
layout->addWidget(s);
s->setVisible(true);
x++;
if (x <= 3) {
@ -420,6 +421,13 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
_permissionReshare->setVisible(false);
}
//If the initiator is not you. And the recipient is not you. Show it without any options.
if(share->account()->id() != share->getId() && share->account()->davUser() != share->getShareWith()->shareWith()){
_ui->permissionsEdit->hide();
_ui->permissionToolButton->hide();
_ui->deleteShareButton->hide();
}
loadAvatar();
}