aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-08-02 14:32:20 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-09-06 03:38:47 +0200
commit1d16bc47ffe7fbbf3f98a773612df6cdfa56f7de (patch)
tree4c377028ab883b1144c4b917302eb17ef4d230ea /apps/files
parente93ceea804284800c1636e7ef199f40c1d33f0b3 (diff)
downloadnextcloud-server-1d16bc47ffe7fbbf3f98a773612df6cdfa56f7de.tar.gz
nextcloud-server-1d16bc47ffe7fbbf3f98a773612df6cdfa56f7de.zip
fix(files_sharing): Handle download permission the same way for public and internal shares
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/actions/downloadAction.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files/src/actions/downloadAction.ts b/apps/files/src/actions/downloadAction.ts
index f1bcb97e279..bac5e4adf10 100644
--- a/apps/files/src/actions/downloadAction.ts
+++ b/apps/files/src/actions/downloadAction.ts
@@ -46,11 +46,11 @@ const isDownloadable = function(node: Node) {
}
// If the mount type is a share, ensure it got download permissions.
- if (node.attributes['mount-type'] === 'shared') {
- const shareAttributes = JSON.parse(node.attributes['share-attributes'] ?? '[]') as Array<ShareAttribute>
- const downloadAttribute = shareAttributes?.find?.((attribute: { scope: string; key: string }) => attribute.scope === 'permissions' && attribute.key === 'download')
- if (downloadAttribute !== undefined && downloadAttribute.value === false) {
- return false
+ if (node.attributes['share-attributes']) {
+ const shareAttributes = JSON.parse(node.attributes['share-attributes'] || '[]') as Array<ShareAttribute>
+ const downloadAttribute = shareAttributes.find(({ scope, key }: ShareAttribute) => scope === 'permissions' && key === 'download')
+ if (downloadAttribute) {
+ return downloadAttribute.value === true
}
}