mirror of
https://github.com/nextcloud/server.git
synced 2026-02-11 23:04:22 -05:00
fix(files): allow downloading folders within user root folders only
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
2845319187
commit
fb30aa0902
12 changed files with 28 additions and 41 deletions
|
|
@ -47,7 +47,19 @@ export const action = new FileAction({
|
|||
iconSvgInline: () => ArrowDownSvg,
|
||||
|
||||
enabled(nodes: Node[]) {
|
||||
return nodes.length > 0 && nodes
|
||||
if (nodes.length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
// We can download direct dav files. But if we have
|
||||
// some folders, we need to use the /apps/files/ajax/download.php
|
||||
// endpoint, which only supports user root folder.
|
||||
if (nodes.some(node => node.type === FileType.Folder)
|
||||
&& !nodes.every(node => node.root?.startsWith('/files'))) {
|
||||
return false
|
||||
}
|
||||
|
||||
return nodes
|
||||
.map(node => node.permissions)
|
||||
.every(permission => (permission & Permission.READ) !== 0)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import { getContents } from './services/systemtags.js'
|
|||
|
||||
const Navigation = getNavigation()
|
||||
Navigation.register(new View({
|
||||
id: 'systemtags',
|
||||
id: 'tags',
|
||||
name: t('systemtags', 'Tags'),
|
||||
caption: t('systemtags', 'List of tags and their associated files and folders.'),
|
||||
|
||||
|
|
|
|||
4
dist/core-common.js
vendored
4
dist/core-common.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-common.js.map
vendored
2
dist/core-common.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/files-sidebar.js.map
vendored
2
dist/files-sidebar.js.map
vendored
File diff suppressed because one or more lines are too long
3
dist/systemtags-init.js
vendored
Normal file
3
dist/systemtags-init.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,9 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @copyright 2023 Christopher Ng <chrng8@gmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Christopher Ng <chrng8@gmail.com>
|
||||
*
|
||||
* @license AGPL-3.0-or-later
|
||||
*
|
||||
|
|
@ -15,7 +14,7 @@
|
|||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
|
|
@ -44,27 +43,3 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Copyright (c) 2016 Vincent Petry <pvince81@owncloud.com>
|
||||
*
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author Vincent Petry <vincent@nextcloud.com>
|
||||
*
|
||||
* @license AGPL-3.0-or-later
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
1
dist/systemtags-init.js.map
vendored
Normal file
1
dist/systemtags-init.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3
dist/systemtags-systemtags.js
vendored
3
dist/systemtags-systemtags.js
vendored
File diff suppressed because one or more lines are too long
1
dist/systemtags-systemtags.js.map
vendored
1
dist/systemtags-systemtags.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue