Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed firmware drawer permissions #956

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions frontend/src/components/Gallery/AppBar/Base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ const auth = storeAuth();
<filter-text-field />
<selecting-btn />
<gallery-view-btn />
<template v-if="auth.scopes.includes('roms.write')">
<v-menu location="bottom">
<template #activator="{ props }">
<v-btn
v-bind="props"
rounded="0"
variant="text"
class="mr-0"
icon="mdi-dots-vertical"
@click.stop
/>
</template>
<admin-menu />
</v-menu>
</template>
<v-menu location="bottom">
<template #activator="{ props }">
<v-btn
v-if="auth.scopes.includes('roms.write')"
v-bind="props"
rounded="0"
variant="text"
class="mr-0"
icon="mdi-dots-vertical"
@click.stop
/>
</template>
<admin-menu />
</v-menu>
</v-app-bar>

<filter-drawer />
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/components/Gallery/FirmwareDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { FirmwareSchema } from "@/__generated__";
import DeleteFirmwareDialog from "@/components/common/Platform/Dialog/DeleteFirmware.vue";
import UploadFirmwareDialog from "@/components/common/Platform/Dialog/UploadFirmware.vue";
import storeAuth from "@/stores/auth";
import storeGalleryView from "@/stores/galleryView";
import storeRoms from "@/stores/roms";
import type { Events } from "@/types/emitter";
Expand All @@ -13,6 +14,7 @@ import { useDisplay } from "vuetify";

// Props
const { xs, mdAndUp } = useDisplay();
const auth = storeAuth();
const romsStore = storeRoms();
const { currentPlatform } = storeToRefs(romsStore);
const galleryViewStore = storeGalleryView();
Expand Down Expand Up @@ -75,7 +77,11 @@ watch(itemsPerPage, async () => {
>
<template #header.actions>
<v-btn-group divided density="compact">
<v-btn size="small" @click="emitter?.emit('addFirmwareDialog', null)">
<v-btn
v-if="auth.scopes.includes('platforms.write')"
size="small"
@click="emitter?.emit('addFirmwareDialog', null)"
>
<v-icon>mdi-upload</v-icon>
</v-btn>
<v-btn
Expand All @@ -87,6 +93,7 @@ watch(itemsPerPage, async () => {
<v-icon>mdi-download</v-icon>
</v-btn>
<v-btn
v-if="auth.scopes.includes('platforms.write')"
:class="{
'text-romm-red': selectedFirmware.length,
}"
Expand Down Expand Up @@ -168,6 +175,7 @@ watch(itemsPerPage, async () => {
<v-icon> mdi-download </v-icon>
</v-btn>
<v-btn
v-if="auth.scopes.includes('platforms.write')"
size="small"
@click="emitter?.emit('showDeleteFirmwareDialog', [item])"
>
Expand Down
Loading