Skip to content

Commit ce911f8

Browse files
committed
Fix file downloading permissions
1 parent 8955b5a commit ce911f8

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

resources/assets/scripts/components/server/components/filemanager/FileContextMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
<div class="action">Copy</div>
2121
</div>
22-
<div class="context-row" v-on:click="triggerAction('download')">
22+
<div class="context-row" v-on:click="triggerAction('download')" v-if="!object.directory">
2323
<div class="icon">
2424
<Icon name="download" class="h-4"/>
2525
</div>

resources/assets/scripts/components/server/components/filemanager/FileRow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
ref="contextMenu"
4040
/>
4141
<CopyFileModal :file="file" v-if="modals.copy" v-on:close="$emit('list')"/>
42-
<DownloadFileModal :file="file" v-if="modals.download" v-on:close="modals.download = false"/>
42+
<DownloadFileModal :file="file" v-if="!file.directory && modals.download" v-on:close="modals.download = false"/>
4343
<DeleteFileModal :visible.sync="modals.delete" :object="file" v-on:deleted="$emit('deleted')" v-on:close="modal.delete = false"/>
4444
<RenameModal :visible.sync="modals.rename" :object="file" v-on:renamed="$emit('list')" v-on:close="modal.rename = false"/>
4545
<MoveFileModal :visible.sync="modals.move" :file="file" v-on:moved="$emit('list')" v-on:close="modal.move = false"/>

resources/assets/scripts/components/server/components/filemanager/modals/DownloadFileModal.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
components: { SpinnerModal },
1919
2020
computed: mapState('server', {
21-
server: (state: ServerState) => state.server,
2221
credentials: (state: ServerState) => state.credentials,
2322
fm: (state: ServerState) => state.fm,
2423
}),
@@ -35,7 +34,7 @@
3534
mounted: function () {
3635
const path = join(this.fm.currentDirectory, this.file.name);
3736
38-
getDownloadToken(this.server.uuid, path)
37+
getDownloadToken(this.$route.params.id, path)
3938
.then((token) => {
4039
if (token) {
4140
window.location.href = `${this.credentials.node}/v1/server/file/download/${token}`;

0 commit comments

Comments
 (0)