From dacd93637b5bd8bdb968a02a13c6e1c03b5dce4d Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Wed, 5 Jun 2024 17:39:21 +0200 Subject: [PATCH] cleaning Signed-off-by: Marino Faggiana --- iOSClient/Menu/NCShare+Menu.swift | 4 ++-- iOSClient/Share/Advanced/NCShareCells.swift | 6 +++--- iOSClient/Share/NCPermissions.swift | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iOSClient/Menu/NCShare+Menu.swift b/iOSClient/Menu/NCShare+Menu.swift index 985afd7980..d497981031 100644 --- a/iOSClient/Menu/NCShare+Menu.swift +++ b/iOSClient/Menu/NCShare+Menu.swift @@ -98,7 +98,7 @@ extension NCShare { on: false, action: { _ in let canShare = permissions.isPermissionToCanShare(tableShare.permissions) - let permissions = permissions.getPermission(canEdit: false, canCreate: false, canChange: false, canDelete: false, canShare: canShare, isFolder: isDirectory) + let permissions = permissions.getPermission(canEdit: false, canCreate: false, canChange: false, canDelete: false, canShare: canShare, isDirectory: isDirectory) self.updateSharePermissions(share: tableShare, permissions: permissions) } ) @@ -112,7 +112,7 @@ extension NCShare { on: false, action: { _ in let canShare = permissions.isPermissionToCanShare(tableShare.permissions) - let permissions = permissions.getPermission(canEdit: true, canCreate: true, canChange: true, canDelete: true, canShare: canShare, isFolder: isDirectory) + let permissions = permissions.getPermission(canEdit: true, canCreate: true, canChange: true, canDelete: true, canShare: canShare, isDirectory: isDirectory) self.updateSharePermissions(share: tableShare, permissions: permissions) } ) diff --git a/iOSClient/Share/Advanced/NCShareCells.swift b/iOSClient/Share/Advanced/NCShareCells.swift index 2c9f347b7d..d1f5d23aba 100644 --- a/iOSClient/Share/Advanced/NCShareCells.swift +++ b/iOSClient/Share/Advanced/NCShareCells.swift @@ -131,7 +131,7 @@ enum NCLinkPermission: NCPermission { canChange: true, canDelete: true, canShare: false, - isFolder: false) + isDirectory: false) case .viewOnly: return NCPermissions().getPermission( canEdit: false, @@ -141,7 +141,7 @@ enum NCLinkPermission: NCPermission { // not possible to create "read-only" shares without reshare option // https://github.com/nextcloud/server/blame/f99876997a9119518fe5f7ad3a3a51d33459d4cc/apps/files_sharing/lib/Controller/ShareAPIController.php#L1104-L1107 canShare: true, - isFolder: true) + isDirectory: true) case .uploadEdit: return NCPermissions().getPermission( canEdit: true, @@ -149,7 +149,7 @@ enum NCLinkPermission: NCPermission { canChange: true, canDelete: true, canShare: false, - isFolder: true) + isDirectory: true) case .fileDrop: return NCPermissions().permissionCreateShare case .secureFileDrop: diff --git a/iOSClient/Share/NCPermissions.swift b/iOSClient/Share/NCPermissions.swift index 76b228626f..97d3258812 100644 --- a/iOSClient/Share/NCPermissions.swift +++ b/iOSClient/Share/NCPermissions.swift @@ -64,19 +64,19 @@ class NCPermissions: NSObject { let canChange = isPermissionToCanChange(permission) return canCreate && canChange && canRead } - func getPermission(canEdit: Bool, canCreate: Bool, canChange: Bool, canDelete: Bool, canShare: Bool, isFolder: Bool) -> Int { + func getPermission(canEdit: Bool, canCreate: Bool, canChange: Bool, canDelete: Bool, canShare: Bool, isDirectory: Bool) -> Int { var permission = permissionReadShare - if canEdit && !isFolder { + if canEdit && !isDirectory { permission = permission + permissionUpdateShare } - if canCreate && isFolder { + if canCreate && isDirectory { permission = permission + permissionCreateShare } - if canChange && isFolder { + if canChange && isDirectory { permission = permission + permissionUpdateShare } - if canDelete && isFolder { + if canDelete && isDirectory { permission = permission + permissionDeleteShare } if canShare {