fix(apps): hide from UI for non-admin users

This commit is contained in:
fiftin 2024-07-19 15:01:21 +05:00
parent fef54a1d5f
commit b4c567f34e
No known key found for this signature in database
GPG Key ID: 044381366A5D4731
2 changed files with 9 additions and 2 deletions

View File

@ -36,6 +36,7 @@
<v-toolbar-title>{{ $t('Applications') }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn
:disabled="!isAdmin"
color="primary"
@click="editItem('')"
>{{ $t('New App') }}</v-btn>
@ -49,6 +50,7 @@
>
<template v-slot:item.active="{ item }">
<v-switch
:disabled="!isAdmin"
v-model="item.active"
inset
@change="setActive(item.id, item.active)"
@ -101,13 +103,14 @@ import YesNoDialog from '@/components/YesNoDialog.vue';
import ItemListPageBase from '@/components/ItemListPageBase';
import EditDialog from '@/components/EditDialog.vue';
import axios from 'axios';
import PermissionsCheck from '@/components/PermissionsCheck';
import AppForm from '../components/AppForm.vue';
import { DEFAULT_APPS } from '../lib/constants';
import AppsMixin from '../components/AppsMixin';
import delay from '../lib/delay';
export default {
mixins: [ItemListPageBase, AppsMixin],
mixins: [ItemListPageBase, AppsMixin, PermissionsCheck],
components: {
AppForm,

View File

@ -62,6 +62,7 @@
color="primary"
class="mr-1 pr-2"
v-if="can(USER_PERMISSIONS.manageProjectResources)"
:disabled="!isAdmin && appsMixin.activeAppIds.length === 0"
>
{{ $t('newTemplate') }}
<v-icon>mdi-chevron-down</v-icon>
@ -83,8 +84,11 @@
</v-list-item-icon>
<v-list-item-title>{{ getAppTitle(appID) }}</v-list-item-title>
</v-list-item>
<v-divider/>
<v-divider v-if="isAdmin && appsMixin.activeAppIds.length > 0"/>
<v-list-item
v-if="isAdmin"
key="other"
link
href="/apps"