check has permission assign

This commit is contained in:
Tim Gröger 2023-05-03 06:11:52 +02:00
parent 6f6fca84ed
commit 3fbbacabca
1 changed files with 4 additions and 1 deletions

View File

@ -54,7 +54,7 @@
</q-select> </q-select>
<div class="row col-12 justify-end"> <div class="row col-12 justify-end">
<q-btn <q-btn
v-if="!modelValue.locked && !isEnrolled && !isFull" v-if="!modelValue.locked && !isEnrolled && !isFull && canAssign"
flat flat
color="primary" color="primary"
label="Eintragen" label="Eintragen"
@ -205,6 +205,8 @@ export default defineComponent({
// Current user can assign other users // Current user can assign other users
const canAssignOther = computed(() => hasPermission(PERMISSIONS.ASSIGN_OTHER)); const canAssignOther = computed(() => hasPermission(PERMISSIONS.ASSIGN_OTHER));
const canAssign = computed(() => hasPermission(PERMISSIONS.ASSIGN));
// options shown in the select // options shown in the select
const options = ref([] as FG.Service[]); const options = ref([] as FG.Service[]);
@ -257,6 +259,7 @@ export default defineComponent({
unassign: (s?: FG.Service) => assign(Object.assign({}, s || service.value, { value: -1 })), unassign: (s?: FG.Service) => assign(Object.assign({}, s || service.value, { value: -1 })),
backup: (is_backup: boolean) => assign(Object.assign({}, service.value, { is_backup })), backup: (is_backup: boolean) => assign(Object.assign({}, service.value, { is_backup })),
canAssignOther, canAssignOther,
canAssign,
canInvite, canInvite,
filterUsers, filterUsers,
isBackup, isBackup,