mirror of
https://github.com/nextcloud/server.git
synced 2026-02-28 12:30:40 -05:00
fix(files): Sanitize share-types attribute in download action
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
e31e5429a8
commit
0f232997e1
1 changed files with 2 additions and 1 deletions
|
|
@ -48,7 +48,8 @@ const isDownloadable = function(node: Node) {
|
|||
|
||||
// If the mount type is a share, ensure it got download permissions.
|
||||
if (node.attributes['mount-type'] === 'shared') {
|
||||
const downloadAttribute = JSON.parse(node.attributes['share-attributes']).find((attribute: { scope: string; key: string }) => attribute.scope === 'permissions' && attribute.key === 'download')
|
||||
const shareAttributes = JSON.parse(node.attributes['share-attributes'] ?? 'null')
|
||||
const downloadAttribute = shareAttributes?.find?.((attribute: { scope: string; key: string }) => attribute.scope === 'permissions' && attribute.key === 'download')
|
||||
if (downloadAttribute !== undefined && downloadAttribute.enabled === false) {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue