Add convenience property to nkshare extension to see if sharees can edit share file...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 5 Mar 2024 09:15:42 +0000 (17:15 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 17 Apr 2024 08:38:56 +0000 (16:38 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Extensions/NKShare+Extensions.swift

index dab519edad352ddcea7c84def33f71476208dabd..ff560bcffd65a79553742e232a3594908f8ef275 100644 (file)
@@ -111,6 +111,17 @@ extension NKShare {
         return dateFormatter.string(from: date as Date)
     }
 
+    var shareesCanEdit: Bool {
+        get { (permissions & PermissionValues.updateShare.rawValue) != 0 }
+        set {
+            if newValue {
+                permissions |= NKShare.PermissionValues.updateShare.rawValue
+            } else {
+                permissions &= ~NKShare.PermissionValues.updateShare.rawValue
+            }
+        }
+    }
+
     static func formattedDateString(date: Date) -> String {
         let dateFormatter = DateFormatter()
         dateFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"