Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "allow download" sharing permission attribute #2500

Closed
wants to merge 7 commits into from

Conversation

mpivchev
Copy link
Collaborator

@mpivchev mpivchev commented Jun 28, 2023

This will close #2425
WIP

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@mpivchev mpivchev changed the title 2425 missing sharing options Add "allow download" sharing permission attribute Jun 28, 2023
@mpivchev mpivchev linked an issue Jun 28, 2023 that may be closed by this pull request
…missing-sharing-options

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>

# Conflicts:
#	iOSClient/Data/NCManageDatabase+Share.swift
Comment on lines 75 to 77
let attributesInternal = List<ShareAttribute>()

var attributes = [NKShare.Attribute]()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Realm wants a List I have to add this internal field

Comment on lines 173 to 202
enum NCShareAttribute: NCToggleCellConfig {
func isOn(for share: NCTableShareable) -> Bool {
print(share.attributes.first(where: { $0.scope == "permission" && $0.key == "download" })?.enabled == true)
switch self {
case.allowDownload: return share.attributes.first(where: { $0.scope == "permission" && $0.key == "download" })?.enabled == true
}
}

func didChange(_ share: NCTableShareable, to newValue: Bool) {
// TODO: implement
}

var title: String {
switch self {
case .allowDownload: return NSLocalizedString("_share_attribute_allow_download_", comment: "")
}
}

// func getCell(for share: NCTableShareable) -> UITableViewCell {
// <#code#>
// }
//
// func didSelect(for share: NCTableShareable) {
// <#code#>
// }

case allowDownload
static let forAll: [NCShareAttribute] = [.allowDownload]
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I make another share NCToggleCellConfig, but for attributes

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@marinofaggiana marinofaggiana deleted the 2425-missing-sharing-options branch August 7, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing sharing options
2 participants