aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-09-04 23:07:02 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-09-06 03:38:48 +0200
commitc9dc0afcb1c571deae7b43550ed8bc52b9c77afc (patch)
tree7a4bf380d294936fd12c8227d1eb48bfba9d9efb /apps/files/src
parent11fdf4e2a7435a337db920d751583c83cdf74c91 (diff)
downloadnextcloud-server-c9dc0afcb1c571deae7b43550ed8bc52b9c77afc.tar.gz
nextcloud-server-c9dc0afcb1c571deae7b43550ed8bc52b9c77afc.zip
fix(files): "New folder" menu entry requires read permission
This will disable "New folder" menu entry for file-drop shares. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/components/FilesListTableHeaderActions.vue12
-rw-r--r--apps/files/src/newMenu/newFolder.ts2
2 files changed, 8 insertions, 6 deletions
diff --git a/apps/files/src/components/FilesListTableHeaderActions.vue b/apps/files/src/components/FilesListTableHeaderActions.vue
index 5e32a07eae1..a5732220441 100644
--- a/apps/files/src/components/FilesListTableHeaderActions.vue
+++ b/apps/files/src/components/FilesListTableHeaderActions.vue
@@ -13,6 +13,7 @@
:open.sync="openedMenu">
<NcActionButton v-for="action in enabledActions"
:key="action.id"
+ :aria-label="action.displayName(nodes, currentView) + ' ' + t('files', '(selected)') /** TRANSLATORS: Selected like 'selected files and folders' */"
:class="'files-list__row-actions-batch-' + action.id"
@click="onActionClick(action)">
<template #icon>
@@ -40,6 +41,7 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
+import { useRouteParameters } from '../composables/useRouteParameters.ts'
import { useActionsMenuStore } from '../store/actionsmenu.ts'
import { useFilesStore } from '../store/files.ts'
import { useSelectionStore } from '../store/selection.ts'
@@ -78,7 +80,11 @@ export default defineComponent({
const actionsMenuStore = useActionsMenuStore()
const filesStore = useFilesStore()
const selectionStore = useSelectionStore()
+ const { directory } = useRouteParameters()
+
return {
+ directory,
+
actionsMenuStore,
filesStore,
selectionStore,
@@ -92,10 +98,6 @@ export default defineComponent({
},
computed: {
- dir() {
- // Remove any trailing slash but leave root slash
- return (this.$route?.query?.dir || '/').replace(/^(.+)\/$/, '$1')
- },
enabledActions() {
return actions
.filter(action => action.execBatch)
@@ -157,7 +159,7 @@ export default defineComponent({
})
// Dispatch action execution
- const results = await action.execBatch(this.nodes, this.currentView, this.dir)
+ const results = await action.execBatch(this.nodes, this.currentView, this.directory)
// Check if all actions returned null
if (!results.some(result => result !== null)) {
diff --git a/apps/files/src/newMenu/newFolder.ts b/apps/files/src/newMenu/newFolder.ts
index 1e8b2b1cadc..9a8badb4eb7 100644
--- a/apps/files/src/newMenu/newFolder.ts
+++ b/apps/files/src/newMenu/newFolder.ts
@@ -42,7 +42,7 @@ const createNewFolder = async (root: Folder, name: string): Promise<createFolder
export const entry = {
id: 'newFolder',
displayName: t('files', 'New folder'),
- enabled: (context: Folder) => (context.permissions & Permission.CREATE) !== 0,
+ enabled: (context: Folder) => Boolean(context.permissions & Permission.CREATE) && Boolean(context.permissions & Permission.READ),
iconSvgInline: FolderPlusSvg,
order: 0,
async handler(context: Folder, content: Node[]) {