]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Simplify check for file record sharing permission
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 15 Feb 2023 17:47:17 +0000 (18:47 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 16 Feb 2023 12:06:35 +0000 (13:06 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/sharemodel.cpp

index aa406cdd0543ce47ff1cf37b711fe4a35705292c..8c3735f288b57d591f43cc9820b792e479cddae8 100644 (file)
@@ -240,12 +240,13 @@ void ShareModel::updateData()
     SyncJournalFileRecord fileRecord;
     auto resharingAllowed = true; // lets assume the good
 
-    if(_folder->journalDb()->getFileRecord(relPath, &fileRecord) && fileRecord.isValid()) {
-        if (!fileRecord._remotePerm.isNull() &&
-            !fileRecord._remotePerm.hasPermission(RemotePermissions::CanReshare)) {
+    if(_folder->journalDb()->getFileRecord(relPath, &fileRecord) &&
+       fileRecord.isValid() &&
+       !fileRecord._remotePerm.isNull() &&
+       !fileRecord._remotePerm.hasPermission(RemotePermissions::CanReshare)) {
 
-            resharingAllowed = false;
-        }
+        qCInfo(lcShareModel) << "File record says resharing not allowed";
+        resharingAllowed = false;
     }
 
     _maxSharingPermissions = resharingAllowed ? SharePermissions(_accountState->account()->capabilities().shareDefaultPermissions()) : SharePermissions({});