marinofaggiana %!s(int64=5) %!d(string=hai) anos
pai
achega
2708732da3
Modificáronse 2 ficheiros con 12 adicións e 3 borrados
  1. 2 0
      iOSClient/Nextcloud-Bridging-Header.h
  2. 10 3
      iOSClient/Share/NCShare.swift

+ 2 - 0
iOSClient/Nextcloud-Bridging-Header.h

@@ -19,7 +19,9 @@
 #import "OCExternalSites.h"
 #import "OCSharedDto.h"
 #import "OCNotifications.h"
+#import "OCConstants.h"
 #import "OCNotificationsAction.h"
+#import "UtilsFramework.h"
 #import "NCNetworkingEndToEnd.h"
 #import "NCRichDocumentTemplate.h"
 #import "HCFeatures.h"

+ 10 - 3
iOSClient/Share/NCShare.swift

@@ -389,6 +389,13 @@ extension NCShare: UITableViewDataSource {
                 cell.delegate = self
                 cell.labelTitle.text = tableShare.shareWith
                 NCShareCommon.sharedInstance.downloadAvatar(user: tableShare.shareWith, cell: cell)
+                
+                if UtilsFramework.isAnyPermission(toEdit: tableShare.permissions) {
+                    cell.switchCanEdit.setOn(true, animated: false)
+                } else {
+                    cell.switchCanEdit.setOn(false, animated: false)
+
+                }
                 return cell
             }
         }
@@ -542,7 +549,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         tableShare = NCManageDatabase.sharedInstance.getTableShare(account: metadata!.account, idRemoteShared: idRemoteShared)
         
         // Allow editing
-        if tableShare != nil && tableShare!.permissions > 1 {
+        if tableShare != nil && tableShare!.permissions > Int(k_read_share_permission) {
             switchAllowEditing.setOn(true, animated: false)
         } else {
             switchAllowEditing.setOn(false, animated: false)
@@ -596,9 +603,9 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         
         var permission = 0
         if sender.isOn {
-            permission = 3
+            permission = Int(k_read_share_permission) + Int(k_update_share_permission)
         } else {
-            permission = 1
+            permission = Int(k_read_share_permission)
         }
         
         let networking = NCShareNetworking.init(account: metadata!.account, activeUrl: appDelegate.activeUrl,  view: self, delegate: self)