Add role for resharing allowed in share model
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 10 Aug 2023 08:03:14 +0000 (16:03 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 11 Aug 2023 14:59:59 +0000 (22:59 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/sharemodel.cpp
src/gui/filedetails/sharemodel.h

index bcf2c8af9d19fbe96689fa81e329ab3772076314..22e3cd7641ce3f5e75cd729b12a5c99eee9a74ee 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "account.h"
 #include "folderman.h"
+#include "sharepermissions.h"
 #include "theme.h"
 
 namespace {
@@ -141,6 +142,7 @@ QHash<int, QByteArray> ShareModel::roleNames() const
     roles[IsSharePermissionsChangeInProgress] = "isSharePermissionChangeInProgress";
     roles[HideDownloadEnabledRole] = "hideDownload";
     roles[IsHideDownloadEnabledChangeInProgress] = "isHideDownloadInProgress";
+    roles[ResharingAllowedRole] = "resharingAllowed";
 
     return roles;
 }
@@ -241,6 +243,8 @@ QVariant ShareModel::data(const QModelIndex &index, const int role) const
                 || (share->getShareType() == Share::TypeLink && _accountState->account()->capabilities().sharePublicLinkEnforcePassword()));
     case EditingAllowedRole:
         return share->getPermissions().testFlag(SharePermissionUpdate);
+    case ResharingAllowedRole:
+        return share->getPermissions().testFlag(SharePermissionShare);
 
     // Deal with roles that only return certain values for link or user/group share types
     case NoteEnabledRole:
index 71458fcc7da2ce330c786c5fae066b3396ba9a62..8655d8ebdc21fc6a9a930b8b12b5d18f93f70882 100644 (file)
@@ -62,6 +62,7 @@ public:
         IsSharePermissionsChangeInProgress,
         HideDownloadEnabledRole,
         IsHideDownloadEnabledChangeInProgress,
+        ResharingAllowedRole,
     };
     Q_ENUM(Roles)