mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
fix(apps): hide from UI for non-admin users
This commit is contained in:
parent
fef54a1d5f
commit
b4c567f34e
@ -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,
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user