@@ -259,4 +259,12 @@ extension NCManageDatabase {
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
}
+
+ func setAttibuteDownload(state: Bool) -> String? {
+ if state {
+ return nil
+ } else {
+ return "[{\"scope\":\"permissions\",\"key\":\"download\",\"enabled\":false}]"
+ }
@@ -73,8 +73,9 @@ enum NCUserPermission: CaseIterable, NCPermission {
func didChange(_ share: NCTableShareable, to newValue: Bool) {
+ // ATTRIBUTES
if self == .download {
- // ATTRIBUTES
+ share.attributes = NCManageDatabase.shared.setAttibuteDownload(state: newValue)
} else {
share.permissions ^= permissionBitFlag