Adds parameter to retrieve shares with its reshares.
authorCamila San <hello@camila.codes>
Thu, 9 May 2019 20:11:25 +0000 (22:11 +0200)
committerCamila San <hello@camila.codes>
Mon, 27 May 2019 17:46:38 +0000 (19:46 +0200)
If the initiator or the recipient is not the current user,
show the list of sharees without any options to edit it.

Minor change: updates api to v2.

Signed-off-by: Camila San <hello@camila.codes>
src/gui/ocsshareejob.cpp
src/gui/ocssharejob.cpp
src/gui/shareusergroupwidget.cpp

index 0d1b6d44b2c7977824dd0609398459dd957f8dd1..ced73800f1cbebf56c9230b69b72bc0c3ab32b59 100644 (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);
 }
 
index 5202254618bc89e42c8bee65946528ae4de183e7..15884e0126b2794aa7d76b7dccf21055a6a51e06 100644 (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();
index 6f85809d91269f07306f6ccd63acfc6d73c075ec..27d80ed7828ceaa251fb43aea190ae7ee270a9dc 100644 (file)
@@ -420,6 +420,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();
 }