mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
fix: buttons without permission on header
This commit is contained in:
parent
fcb115f42d
commit
1516d9932b
@ -10,26 +10,22 @@
|
|||||||
{{ $t("settings.profileSettings") }}
|
{{ $t("settings.profileSettings") }}
|
||||||
</li></router-link
|
</li></router-link
|
||||||
>
|
>
|
||||||
<router-link to="/settings/shares"
|
<router-link to="/settings/shares" v-if="user.perm.share"
|
||||||
><li :class="{ active: $route.path === '/settings/shares' }">
|
><li :class="{ active: $route.path === '/settings/shares' }">
|
||||||
{{ $t("settings.shareManagement") }}
|
{{ $t("settings.shareManagement") }}
|
||||||
</li></router-link
|
</li></router-link
|
||||||
>
|
>
|
||||||
<router-link to="/settings/global"
|
<router-link to="/settings/global" v-if="user.perm.admin"
|
||||||
><li
|
><li :class="{ active: $route.path === '/settings/global' }">
|
||||||
:class="{ active: $route.path === '/settings/global' }"
|
|
||||||
v-if="user.perm.admin"
|
|
||||||
>
|
|
||||||
{{ $t("settings.globalSettings") }}
|
{{ $t("settings.globalSettings") }}
|
||||||
</li></router-link
|
</li></router-link
|
||||||
>
|
>
|
||||||
<router-link to="/settings/users"
|
<router-link to="/settings/users" v-if="user.perm.admin"
|
||||||
><li
|
><li
|
||||||
:class="{
|
:class="{
|
||||||
active:
|
active:
|
||||||
$route.path === '/settings/users' || $route.name === 'User',
|
$route.path === '/settings/users' || $route.name === 'User',
|
||||||
}"
|
}"
|
||||||
v-if="user.perm.admin"
|
|
||||||
>
|
>
|
||||||
{{ $t("settings.userManagement") }}
|
{{ $t("settings.userManagement") }}
|
||||||
</li></router-link
|
</li></router-link
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<action
|
<action
|
||||||
|
v-if="user.perm.modify"
|
||||||
id="save-button"
|
id="save-button"
|
||||||
icon="save"
|
icon="save"
|
||||||
:label="$t('buttons.save')"
|
:label="$t('buttons.save')"
|
||||||
|
@ -58,12 +58,14 @@
|
|||||||
@action="switchView"
|
@action="switchView"
|
||||||
/>
|
/>
|
||||||
<action
|
<action
|
||||||
|
v-if="headerButtons.download"
|
||||||
icon="file_download"
|
icon="file_download"
|
||||||
:label="$t('buttons.download')"
|
:label="$t('buttons.download')"
|
||||||
@action="download"
|
@action="download"
|
||||||
:counter="selectedCount"
|
:counter="selectedCount"
|
||||||
/>
|
/>
|
||||||
<action
|
<action
|
||||||
|
v-if="headerButtons.upload"
|
||||||
icon="file_upload"
|
icon="file_upload"
|
||||||
id="upload-button"
|
id="upload-button"
|
||||||
:label="$t('buttons.upload')"
|
:label="$t('buttons.upload')"
|
||||||
@ -378,6 +380,8 @@ export default {
|
|||||||
window.addEventListener("keydown", this.keyEvent);
|
window.addEventListener("keydown", this.keyEvent);
|
||||||
window.addEventListener("scroll", this.scrollEvent);
|
window.addEventListener("scroll", this.scrollEvent);
|
||||||
window.addEventListener("resize", this.windowsResize);
|
window.addEventListener("resize", this.windowsResize);
|
||||||
|
|
||||||
|
if (!this.user.perm.create) return;
|
||||||
document.addEventListener("dragover", this.preventDefault);
|
document.addEventListener("dragover", this.preventDefault);
|
||||||
document.addEventListener("dragenter", this.dragEnter);
|
document.addEventListener("dragenter", this.dragEnter);
|
||||||
document.addEventListener("dragleave", this.dragLeave);
|
document.addEventListener("dragleave", this.dragLeave);
|
||||||
@ -388,6 +392,8 @@ export default {
|
|||||||
window.removeEventListener("keydown", this.keyEvent);
|
window.removeEventListener("keydown", this.keyEvent);
|
||||||
window.removeEventListener("scroll", this.scrollEvent);
|
window.removeEventListener("scroll", this.scrollEvent);
|
||||||
window.removeEventListener("resize", this.windowsResize);
|
window.removeEventListener("resize", this.windowsResize);
|
||||||
|
|
||||||
|
if (!this.user.perm.create) return;
|
||||||
document.removeEventListener("dragover", this.preventDefault);
|
document.removeEventListener("dragover", this.preventDefault);
|
||||||
document.removeEventListener("dragenter", this.dragEnter);
|
document.removeEventListener("dragenter", this.dragEnter);
|
||||||
document.removeEventListener("dragleave", this.dragLeave);
|
document.removeEventListener("dragleave", this.dragLeave);
|
||||||
|
@ -17,12 +17,14 @@
|
|||||||
<template #actions>
|
<template #actions>
|
||||||
<action
|
<action
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
|
v-if="user.perm.rename"
|
||||||
icon="mode_edit"
|
icon="mode_edit"
|
||||||
:label="$t('buttons.rename')"
|
:label="$t('buttons.rename')"
|
||||||
show="rename"
|
show="rename"
|
||||||
/>
|
/>
|
||||||
<action
|
<action
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
|
v-if="user.perm.delete"
|
||||||
icon="delete"
|
icon="delete"
|
||||||
:label="$t('buttons.delete')"
|
:label="$t('buttons.delete')"
|
||||||
@action="deleteFile"
|
@action="deleteFile"
|
||||||
@ -30,6 +32,7 @@
|
|||||||
/>
|
/>
|
||||||
<action
|
<action
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
|
v-if="user.perm.download"
|
||||||
icon="file_download"
|
icon="file_download"
|
||||||
:label="$t('buttons.download')"
|
:label="$t('buttons.download')"
|
||||||
@action="download"
|
@action="download"
|
||||||
|
Loading…
Reference in New Issue
Block a user